530件ヒット
[1-100件を表示]
(0.038秒)
ライブラリ
- ビルトイン (204)
- csv (24)
- digest (12)
- forwardable (36)
-
minitest
/ spec (1) -
minitest
/ unit (1) - pp (12)
- prime (12)
-
rdoc
/ context (12) -
rubygems
/ command _ manager (12) - singleton (12)
- syslog (12)
-
webrick
/ httpservlet / abstract (12) -
webrick
/ httpservlet / prochandler (12)
クラス
- BasicObject (36)
- CSV (24)
-
Gem
:: CommandManager (12) - Module (72)
- Object (85)
- Prime (12)
-
RDoc
:: Context (12) - UnboundMethod (24)
-
WEBrick
:: HTTPServlet :: AbstractServlet (12) -
WEBrick
:: HTTPServlet :: ProcHandler (12)
モジュール
- Forwardable (36)
-
MiniTest
:: Assertions (1) - Singleton (12)
- Syslog (12)
キーワード
- TYPES (12)
-
assert
_ instance _ of (1) -
def
_ instance _ delegator (12) -
def
_ instance _ delegators (12) -
get
_ instance (24) -
ins
_ methods _ i (12) -
ins
_ methods _ priv _ i (12) -
ins
_ methods _ prot _ i (12) - inspect (12)
- instance (72)
-
instance
_ delegate (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) -
must
_ be _ instance _ of (1) -
pretty
_ print _ instance _ variables (12) -
private
_ instance _ methods (12) -
protected
_ instance _ methods (12) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
rb
_ class _ allocate _ instance (12) -
rb
_ class _ instance _ methods (12) -
rb
_ class _ new _ instance (12) -
rb
_ class _ private _ instance _ methods (12) -
rb
_ class _ protected _ instance _ methods (12) -
rb
_ is _ instance _ id (12) -
rb
_ obj _ instance _ eval (12) -
rb
_ obj _ instance _ variables (12) -
rb
_ obj _ is _ instance _ of (12) -
rb
_ obj _ remove _ instance _ variable (12) -
remove
_ instance _ variable (12) -
to
_ s (12)
検索結果
先頭5件
-
static int ins
_ methods _ i(ID key , NODE *body , VALUE ary) (26116.0) -
rb_class_instance_methods() のイテレータブロック (通常版)。
...rb_class_instance_methods() のイテレータブロック (通常版)。... -
static int ins
_ methods _ priv _ i(ID key , NODE *body , VALUE ary) (26116.0) -
rb_class_instance_methods() のイテレータブロック (private メソッド版)。
...rb_class_instance_methods() のイテレータブロック
(private メソッド版)。... -
static int ins
_ methods _ prot _ i(ID key , NODE *body , VALUE ary) (26116.0) -
rb_class_instance_methods() のイテレータブロック (protected メソッド版)。
...rb_class_instance_methods() のイテレータブロック
(protected メソッド版)。... -
Digest
:: Instance (24000.0) -
-
Module
# instance _ methods(inherited _ too = true) -> [Symbol] (12273.0) -
そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。
...) end
end
# あるクラスのインスタンスメソッドの一覧を得る
p Foo.instance_methods(false)
p Foo.public_instance_methods(false)
p Foo.private_instance_methods(false)
p Foo.protected_instance_methods(false)
class Bar < Foo
end
//}
実行結果
[:protected_foo, :public_fo......p Bar.instance_methods(true) - Object.instance_methods(true)
p Bar.public_instance_methods(true) - Object.public_instance_methods(true)
p Bar.private_instance_methods(true) - Object.private_instance_methods(true)
p Bar.protected_instance_methods(true) - Object.protected_instance_metho... -
BasicObject
# instance _ eval {|obj| . . . } -> object (12268.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...では instance_eval の外側のスコープと、ブロックの評価ではそのブロックの外側のスコープと、共有します。
メソッド定義の中で instance_eval でメソッドを定義した場合は、囲むメソッドが実行されたときに
初めて instance_eval......ド定義のネストと同じです。
d:spec/def#nest_method を参照してください。
BasicObject を継承して作ったクラス内で instance_eval する場合はトップレベルの定数や Kernel モジュールに定義されているメソッドは見えません。
これは、......'secret'
end
end
some = Foo.new 'XXX'
some.instance_eval{p @key} #=> "XXX"
some.instance_eval{do_fuga } #=> "secret" # private メソッドも呼び出せる
some.instance_eval 'raise' # ..:10: (eval):1: (RuntimeError)
messg = 'unknown'
some.instance_eval 'raise messg','file.rb',999 # file.rb:9... -
BasicObject
# instance _ eval(expr , filename = "(eval)" , lineno = 1) -> object (12268.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...では instance_eval の外側のスコープと、ブロックの評価ではそのブロックの外側のスコープと、共有します。
メソッド定義の中で instance_eval でメソッドを定義した場合は、囲むメソッドが実行されたときに
初めて instance_eval......ド定義のネストと同じです。
d:spec/def#nest_method を参照してください。
BasicObject を継承して作ったクラス内で instance_eval する場合はトップレベルの定数や Kernel モジュールに定義されているメソッドは見えません。
これは、......'secret'
end
end
some = Foo.new 'XXX'
some.instance_eval{p @key} #=> "XXX"
some.instance_eval{do_fuga } #=> "secret" # private メソッドも呼び出せる
some.instance_eval 'raise' # ..:10: (eval):1: (RuntimeError)
messg = 'unknown'
some.instance_eval 'raise messg','file.rb',999 # file.rb:9... -
Object
# instance _ variable _ defined?(var) -> bool (12237.0) -
インスタンス変数 var が定義されていたら真を返します。
..., @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true
p fred.instance_variable_defined?("@b") #=> true
p fred.instance_variable_defined?("@c") #=> false
//}
@see Object#instance_variable_get,Object#instance_variable_set,Object#instance_variables... -
Object
# instance _ variable _ get(var) -> object | nil (12237.0) -
オブジェクトのインスタンス変数の値を取得して返します。
...Foo
def initialize
@foo = 1
end
end
obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variable_get(:@bar) #=> nil
//}
@see Object#instance_variable_set,Object#instance_variables,Object#instance_variable_defined?...