499件ヒット
[1-100件を表示]
(0.031秒)
ライブラリ
- ビルトイン (276)
- pp (12)
-
rdoc
/ context (12) - syslog (12)
クラス
- Method (12)
- Module (108)
- Object (84)
-
RDoc
:: Context (12) - UnboundMethod (36)
オブジェクト
- main (24)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
- TYPES (12)
- arity (12)
-
class
_ variables (12) - constants (24)
-
define
_ method (48) -
global
_ variables (12) -
initialize
_ copy (12) -
ins
_ methods _ i (12) -
ins
_ methods _ priv _ i (12) -
ins
_ methods _ prot _ i (12) -
instance
_ methods (12) -
instance
_ variables (12) -
local
_ variables (12) - methods (12)
- name (12)
-
original
_ name (12) - parameters (12)
-
pretty
_ print _ instance _ variables (12) -
private
_ instance _ methods (12) -
private
_ methods (12) -
protected
_ instance _ methods (12) -
protected
_ methods (12) -
public
_ instance _ methods (12) -
public
_ methods (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
rubygems
/ command _ manager (12) - クラス/メソッドの定義 (12)
- パターンマッチ (4)
検索結果
先頭5件
-
Syslog
. # instance -> self (21101.0) -
selfを返します。(旧版との互換性のため)
selfを返します。(旧版との互換性のため) -
Object
# pretty _ print _ instance _ variables -> [String | Symbol] (12201.0) -
プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。 返されたインスタンス変数はプリティプリント時に表示されます。
プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。
返されたインスタンス変数はプリティプリント時に表示されます。
pp に表示したくないインスタンス変数がある場合にこのメソッドを再定義します。 -
Module
# instance _ methods(inherited _ too = true) -> [Symbol] (6273.0) -
そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。
...1][ruby]{
class Foo
private; def private_foo() end
protected; 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_metho......ds(false)
p Foo.protected_instance_methods(false)
class Bar < Foo
end
//}
実行結果
[:protected_foo, :public_foo]
[:public_foo]
[:private_foo]
[:protected_foo]
//emlist[例2][ruby]{
class Bar
private; def private_foo() end
protected; def protected_foo() end
publi......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... -
Module
# private _ instance _ methods(inherited _ too = true) -> [Symbol] (6219.0) -
そのモジュールで定義されている private メソッド名 の一覧を配列で返します。
...@see Object#private_methods, Module#instance_methods
//emlist[例][ruby]{
module Foo
def foo; end
private def bar; end
end
module Bar
include Foo
def baz; end
private def qux; end
end
Bar.private_instance_methods # => [:qux, :bar]
Bar.private_instance_methods(false) # => [:qux]
//}... -
Object
# instance _ variables -> [Symbol] (6219.0) -
オブジェクトのインスタンス変数名をシンボルの配列として返します。
...スタンス変数名をシンボルの配列として返します。
//emlist[][ruby]{
obj = Object.new
obj.instance_eval { @foo, @bar = nil }
p obj.instance_variables
#=> [:@foo, :@bar]
//}
@see Object#instance_variable_get, Kernel.#local_variables, Kernel.#global_variables, Module.constants, M... -
Module
# protected _ instance _ methods(inherited _ too = true) -> [Symbol] (6207.0) -
そのモジュールで定義されている protected メソッド名 の一覧を配列で返します。
...そのモジュールで定義されている protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#protected_methods, Module#instance_methods... -
Module
# public _ instance _ methods(inherited _ too = true) -> [Symbol] (6207.0) -
そのモジュールで定義されている public メソッド名 の一覧を配列で返します。
...そのモジュールで定義されている public メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#public_methods, Module#instance_methods... -
RDoc
:: Context :: TYPES -> ["class" , "instance"] (6201.0) -
メソッドの種類を文字列の配列で返します。
メソッドの種類を文字列の配列で返します。 -
UnboundMethod
# arity -> Integer (6160.0) -
メソッドが受け付ける引数の数を返します。
...ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end
p C.instance_method(:one).arity #=> 0
p C.instance_method(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C.instance_me......(:four).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3
String.instance_method(:size).arity #=> 0
String.instance_method(:replace).arity #=> 1
String.instance_method(:squeeze).arity #=> -1
String.instance_method(:count).arity #=> -1...