“这是一个存根,用于索引”在大多数方法中?

时间:2013-03-24 17:40:04

标签: ruby rubymine

我正在调查curses.rb宝石的curses,我发现这到处都是:

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

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

1 个答案:

答案 0 :(得分:40)

您是否有机会使用RubyMine的“转到定义”(或者它在那里称之为什么)来查看它?

如果是这样,那么可能的原因是这些方法是用C实现的,IDE不能显示ruby代码,因为没有。但是它知道方法签名并且它生成那些假身体以帮助它的智能感知(方法名称完成和东西)。