2013-03-24 6 views
12

ja badał curses.rb z curses gem, znalazłem to wszędzie:"To jest stub, używany do indeksowania" w większości metod?

def attrset(attrs) 
    #This is a stub, used for indexing 
end 
# bkgdset(ch) 
# 
# Manipulate the background of the current window 
# with character Integer +ch+ 
# 
# see also Curses.bkgdset 
def bkgdset(ch) 
    #This is a stub, used for indexing 
end 
# bkgd(ch) 
# 
# Set the background of the current window 
# and apply character Integer +ch+ to every character. 
# 
# see also Curses.bkgd 
def bkgd(ch) 
    #This is a stub, used for indexing 
end 
# Returns an Interer (+ch+) for the character property in the current window. 
def getbkgd() 
    #This is a stub, used for indexing 
end 

Nie rozumiem część skrótowe. Gdzie jest kod, który faktycznie wykonuje całą pracę?

Odpowiedz

37

Czy przypadkiem nie oglądasz tego z "Przejdź do definicji" RubyMine (lub jak tam się nazywa)?

Jeśli tak, to prawdopodobną przyczyną jest to, że metody te są zaimplementowane w języku C, a IDE nie może pokazać kodu ruby, ponieważ go nie ma. Ale zna sygnatury metod i generuje te fałszywe ciała, aby wspomóc swoją intellisense (uzupełnianie nazw metod i inne).

+4

Woah, na miejscu. To wyjaśnia wszystko. – ntl0ve

Powiązane problemy