種類
- インスタンスメソッド (132)
- 関数 (72)
- 文書 (24)
- ライブラリ (12)
ライブラリ
- ビルトイン (132)
モジュール
- Enumerable (24)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - grep (24)
-
ins
_ methods _ i (12) -
ins
_ methods _ priv _ i (12) -
ins
_ methods _ prot _ i (12) - irb (12)
- methods (12)
-
private
_ instance _ methods (12) -
private
_ methods (12) -
protected
_ instance _ methods (12) -
protected
_ methods (12) -
public
_ instance _ methods (12) -
public
_ methods (12) -
rb
_ class _ instance _ methods (12) -
rb
_ class _ private _ instance _ methods (12) -
rb
_ class _ protected _ instance _ methods (12) -
ruby 1
. 6 feature (12) -
undef
_ method (12)
検索結果
先頭5件
-
Object
# methods(include _ inherited = true) -> [Symbol] (30.0) -
そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。
...obj.methods(true) - Object.instance_methods(true)
p obj.public_methods(true) - Object.public_instance_methods(true)
p obj.private_methods(true) - Object.private_instance_methods(true)
p obj.protected_methods(true) - Object.protected_instance_methods(true)
# 実行結果
[:protected_s......ublic_singleton, :protected_foo, :public_foo, :protected_parent, :public_parent]
[:public_singleton, :public_foo, :public_parent]
[:private_singleton, :private_foo, :private_parent]
[:protected_singleton, :protected_foo, :protected_parent]
//}
@see Module#instance_methods,Object#singleton_methods... -
Module
# undef _ method(*name) -> self (24.0) -
このモジュールのインスタンスメソッド name を未定義にします。
...module M1
def foo
end
def self.moo
undef foo
end
end
M1.instance_methods false #=> ["foo"]
M1.moo
M1.instance_methods false #=> []
module M2
def foo
end
def self.moo
undef_method :foo
end
end
M2.instance_methods false #=> ["foo"]
M2.moo
M2.instance_methods false #=> []
//}... -
static int ins
_ methods _ i(ID key , NODE *body , VALUE ary) (16.0) -
rb_class_instance_methods() のイテレータブロック (通常版)。
...rb_class_instance_methods() のイテレータブロック (通常版)。... -
static int ins
_ methods _ priv _ i(ID key , NODE *body , VALUE ary) (16.0) -
rb_class_instance_methods() のイテレータブロック (private メソッド版)。
...rb_class_instance_methods() のイテレータブロック
(private メソッド版)。... -
static int ins
_ methods _ prot _ i(ID key , NODE *body , VALUE ary) (16.0) -
rb_class_instance_methods() のイテレータブロック (protected メソッド版)。
...rb_class_instance_methods() のイテレータブロック
(protected メソッド版)。... -
irb (12.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...4> : running)
#1->irb#1 on main (#<Thread:0x40125d64> : stop)
#2->irb#2 on Foo (#<Thread:0x4011d54c> : stop)
nil
irb(main):005:0> Foo.instance_methods # Foo#fooがちゃんと定義さ
# れている
["foo"]
irb(main):006:0> fg 2......):005:0> def bar # Foo#barを定義
irb#2(Foo):006:1> print "bar"
irb#2(Foo):007:1> end
nil
irb#2(Foo):010:0> Foo.instance_methods
["bar", "foo"]
irb#2(Foo):011:0> fg 0
nil
irb(main):007:0> f = Foo.new
#<Foo:0x4010af3c>
irb(main):008:0> irb f... -
Enumerable
# grep(pattern) -> [object] (6.0) -
pattern === item が成立する要素を全て含んだ配列を返します。
...返します。
@param pattern 「===」メソッドを持つオブジェクトを指定します。
//emlist[例][ruby]{
['aa', 'bb', 'cc', 'dd', 'ee'].grep(/[bc]/) # => ["bb", "cc"]
Array.instance_methods.grep(/gr/) # => [:grep, :group_by]
//}
@see Enumerable#select
@see Enumerable#grep_v... -
Enumerable
# grep(pattern) {|item| . . . } -> [object] (6.0) -
pattern === item が成立する要素を全て含んだ配列を返します。
...返します。
@param pattern 「===」メソッドを持つオブジェクトを指定します。
//emlist[例][ruby]{
['aa', 'bb', 'cc', 'dd', 'ee'].grep(/[bc]/) # => ["bb", "cc"]
Array.instance_methods.grep(/gr/) # => [:grep, :group_by]
//}
@see Enumerable#select
@see Enumerable#grep_v... -
Object
# private _ methods(include _ inherited = true) -> [Symbol] (6.0) -
そのオブジェクトが理解できる private メソッド名の一覧を返します。
...が理解できる private メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#private_instance_methods,Object#methods,Object#singleton_methods...