るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.037秒)

別のキーワード

  1. csv instance
  2. basicobject instance_eval
  3. forwardable instance_delegate
  4. _builtin instance_eval
  5. forwardable def_instance_delegator

ライブラリ

検索結果

Object#respond_to?(name, include_all = false) -> bool (199.0)

オブジェクトがメソッド name を持つとき真を返します。

...します。

メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。

@param name Symbol または文字列で指定するメソッド名です。

@param include_all private メソッドと protected メソッドを確認の...
...になります。

//emlist[][ruby]{
class
F
def hello
"Bonjour"
end
end

class
D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]

list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour

list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello,...
...template_method
finish
end

def start
puts "start"
end

def template_method
raise NotImplementedError.new
end

def finish
puts "finish"
end
end

class
ImplTemplateMethod
include
Template
def template_method
"implement template_method"
end
end

class
NotImplTe...