るりまサーチ (Ruby 2.4.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

モジュール

キーワード

検索結果

<< < ... 16 17 18 >>

UnboundMethod#bind(obj) -> Method (24004.0)

self を obj にバインドした Method オブジェクトを生成して返します。

self を obj にバインドした Method オブジェクトを生成して返します。


@param obj 自身をバインドしたいオブジェクトを指定します。ただしバインドできるのは、
生成元のクラスかそのサブクラスのインスタンスのみです。

@raise TypeError objがbindできないオブジェクトである場合に発生します

//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end
end

# UnboundMethod `m' を生...

UnboundMethod#clone -> UnboundMethod (24004.0)

自身を複製した UnboundMethod オブジェクトを作成して返します。

自身を複製した UnboundMethod オブジェクトを作成して返します。

//emlist[例][ruby]{
a = String.instance_method(:size)
b = a.clone

a == b # => true
//}

UnboundMethod#eql?(other) -> bool (24004.0)

自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。

自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に
true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。

//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true

c = Array.instance_method(:size)
p a == c ...

UnboundMethod#hash -> Integer (24004.0)

自身のハッシュ値を返します。

自身のハッシュ値を返します。


//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}

UnboundMethod#inspect -> String (24004.0)

self を読みやすい文字列として返します。

self を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect

絞り込み条件を変える

UnboundMethod#name -> Symbol (24004.0)

このメソッドの名前を返します。

このメソッドの名前を返します。

//emlist[例][ruby]{
a = String.instance_method(:size)
a.name # => :size
//}

UnboundMethod#original_name -> Symbol (24004.0)

オリジナルのメソッド名を返します。

オリジナルのメソッド名を返します。

//emlist[例][ruby]{
class C
def foo; end
alias bar foo
end
C.instance_method(:bar).original_name # => :foo
//}

@see Method#original_name

UnboundMethod#owner -> Class | Module (24004.0)

このメソッドが定義されている class か module を返します。

このメソッドが定義されている class か module を返します。

//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//}

UnboundMethod#parameters -> [object] (24004.0)

UnboundMethod オブジェクトの引数の情報を返します。

UnboundMethod オブジェクトの引数の情報を返します。

詳しくは Method#parameters を参照してください。



@see Proc#parameters, Method#parameters

UnboundMethod#source_location -> [String, Integer] | nil (24004.0)

ソースコードのファイル名と行番号を配列で返します。

...nil を返します。

//emlist[例][ruby]{
require 'time'

Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}

@see Proc#source_location, Method#source_location...

絞り込み条件を変える

UnboundMethod#super_method -> UnboundMethod | nil (24004.0)

self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ クトにして返します。

self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ
クトにして返します。


@see Method#super_method

UnboundMethod#to_s -> String (24004.0)

self を読みやすい文字列として返します。

self を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect

UncaughtThrowError#tag -> object (24004.0)

Kernel.#throw に指定した tag を返します。

Kernel.#throw に指定した tag を返します。

//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end
//}

UncaughtThrowError#to_s -> String (24004.0)

self を tag を含む文字列表現にして返します。

self を tag を含む文字列表現にして返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//}

UncaughtThrowError#value -> object (24004.0)

Kernel.#throw に指定した value を返します。

Kernel.#throw に指定した value を返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end

begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end
//}

絞り込み条件を変える

Warning#warn(message) -> nil (24004.0)

引数 message を標準エラー出力 $stderr に出力します。

引数 message を標準エラー出力 $stderr に出力します。

Kernel.#warnの挙動を変更する際は、このメソッドではなくクラスメソッドであるWarning.warnをオーバーライドする必要があります。

@param message 出力するオブジェクトを指定します。

@param category 警告のカテゴリを指定します。サポートされている category については Warning.[] を参照してください。


@see Kernel.#warn, Warning.warn
<< < ... 16 17 18 >>