15

我正在调查宝石,我到处都发现了这个curses.rbcurses

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

我不明白存根部分。真正完成所有工作的代码在哪里?

4

1 回答 1

48

您是否有机会使用 RubyMine 的“转到定义”(或者那里叫什么)来查看这个?

如果是这样,那么可能的原因是这些方法是用 C 实现的,而 IDE 无法向您显示 ruby​​ 代码,因为没有。但它知道方法签名,并生成那些虚假的主体以帮助其智能感知(方法名称完成等)。

于 2013-03-24T17:42:47.917 回答