ライブラリ
- ビルトイン (198)
- csv (22)
- digest (11)
- forwardable (33)
- json (11)
-
minitest
/ spec (1) -
minitest
/ unit (2) - openssl (11)
- pp (11)
- prime (11)
-
rdoc
/ context (11) -
rubygems
/ command _ manager (11) - singleton (11)
- syslog (11)
-
webrick
/ httpservlet / abstract (11) -
webrick
/ httpservlet / prochandler (11)
クラス
- BasicObject (33)
- CSV (22)
-
Gem
:: CommandManager (11) -
JSON
:: Parser (11) - Module (77)
- Object (78)
- Prime (11)
-
RDoc
:: Context (11) - UnboundMethod (22)
-
WEBrick
:: HTTPServlet :: AbstractServlet (11) -
WEBrick
:: HTTPServlet :: ProcHandler (11)
モジュール
- Forwardable (33)
-
MiniTest
:: Assertions (2) - Singleton (11)
- Syslog (11)
キーワード
- Digest (11)
- TYPES (11)
-
assert
_ instance _ of (1) -
assert
_ kind _ of (1) - constants (11)
-
def
_ instance _ delegator (11) -
def
_ instance _ delegators (11) -
get
_ instance (22) -
ins
_ methods _ i (11) -
ins
_ methods _ priv _ i (11) -
ins
_ methods _ prot _ i (11) - inspect (11)
- instance (66)
-
instance
_ delegate (11) -
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ methods (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variable _ set (11) -
instance
_ variables (11) -
must
_ be _ instance _ of (1) - new (11)
-
pretty
_ print _ instance _ variables (11) -
private
_ instance _ methods (11) -
protected
_ instance _ methods (11) -
public
_ instance _ method (11) -
public
_ instance _ methods (11) -
rb
_ class _ allocate _ instance (11) -
rb
_ class _ instance _ methods (11) -
rb
_ class _ new _ instance (11) -
rb
_ class _ private _ instance _ methods (11) -
rb
_ class _ protected _ instance _ methods (11) -
rb
_ is _ instance _ id (11) -
rb
_ obj _ instance _ eval (11) -
rb
_ obj _ instance _ variables (11) -
rb
_ obj _ is _ instance _ of (11) -
rb
_ obj _ remove _ instance _ variable (11) -
remove
_ instance _ variable (11) -
to
_ s (11)
検索結果
先頭5件
-
static int ins
_ methods _ i(ID key , NODE *body , VALUE ary) (32216.0) -
rb_class_instance_methods() のイテレータブロック (通常版)。
...rb_class_instance_methods() のイテレータブロック (通常版)。... -
static int ins
_ methods _ priv _ i(ID key , NODE *body , VALUE ary) (32216.0) -
rb_class_instance_methods() のイテレータブロック (private メソッド版)。
...rb_class_instance_methods() のイテレータブロック
(private メソッド版)。... -
static int ins
_ methods _ prot _ i(ID key , NODE *body , VALUE ary) (32216.0) -
rb_class_instance_methods() のイテレータブロック (protected メソッド版)。
...rb_class_instance_methods() のイテレータブロック
(protected メソッド版)。... -
Digest
:: Instance (30000.0) -
-
Object
# pretty _ print _ instance _ variables -> [String | Symbol] (24501.0) -
プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。 返されたインスタンス変数はプリティプリント時に表示されます。
プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。
返されたインスタンス変数はプリティプリント時に表示されます。
pp に表示したくないインスタンス変数がある場合にこのメソッドを再定義します。 -
Object
# instance _ variable _ defined?(var) -> bool (24437.0) -
インスタンス変数 var が定義されていたら真を返します。
...//emlist[][ruby]{
class Fred
def initialize(p1, p2)
@a, @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... -
MiniTest
:: Assertions # assert _ instance _ of(klass , object , message = nil) -> true (24301.0) -
与えられたオブジェクトが与えられたクラスの直接のインスタンスである場合、検査にパスしたことになります。
...Proc#call した
結果を使用します。
@raise MiniTest::Assertion 与えられたオブジェクトが与えられたクラスの直接のインスタンスでない
場合に発生します。
@see Module#===, MiniTest::Assertions#assert_kind_of... -
Singleton
. instance -> object (21301.0) -
そのクラスの唯一のインスタンスを返します。 最初に呼ばれたときはそのインスタンスを生成します。
...そのクラスの唯一のインスタンスを返します。
最初に呼ばれたときはそのインスタンスを生成します。
Singleton を include したクラスで定義されますので、
正確には Singleton モジュールのメソッドではありません。... -
Module
# instance _ methods(inherited _ too = true) -> [Symbol] (18473.0) -
そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。
...いる public および protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#methods
//emlist[例1][ruby]{
class Foo
private; def private_foo() e......d; def protected_foo() end
public; def public_foo() 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......lic; def public_foo() end
end
# あるクラスのインスタンスメソッドの一覧を得る。
# 親のクラスのインスタンスメソッドも含めるため true を指定して
# いるが、Object のインスタンスメソッドは一覧から排除している。
p Bar.inst... -
BasicObject
# instance _ eval(expr , filename = "(eval)" , lineno = 1) -> object (18468.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
...では instance_eval の外側のスコープと、ブロックの評価ではそのブロックの外側のスコープと、共有します。
メソッド定義の中で instance_eval でメソッドを定義した場合は、囲むメソッドが実行されたときに
初めて instance_eval......す。これはメソッド定義のネストと同じです。
d:spec/def#nest_method を参照してください。
BasicObject を継承して作ったクラス内で instance_eval する場合はトップレベルの定数や Kernel モジュールに定義されているメソッドは見え......//emlist[例][ruby]{
class Foo
def initialize data
@key = data
end
private
def do_fuga
p 'secret'
end
end
some = Foo.new 'XXX'
some.instance_eval{p @key} #=> "XXX"
some.instance_eval{do_fuga } #=> "secret" # private メソッドも呼び出せる
some.instance_eval 'raise' # .....