11件ヒット
[1-11件を表示]
(0.247秒)
クラス
- Object (11)
検索結果
-
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (18114.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
...ss Sample
def method_missing(name, *args)
if name =~ /^to_*/
[name, *args] # => [:to_sample, "sample args1", "sample args2"]
return
else
super
end
end
def respond_to_missing?(sym, include_private)
(sym =~ /^to_*/) ? true : super
end
end
s = Sample.new
s.to...