るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. irb/input-method gets
  2. irb/input-method new
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

検索結果

Method#===(*args) -> object (63376.0)

メソッドオブジェクトに封入されているメソッドを起動します。

メソッドオブジェクトに封入されているメソッドを起動します。

引数やブロックはそのままメソッドに渡されます。

self[] の形の呼び出しは通常のメソッド呼び出しに見た目を
近付けるためだけに用意されたもので、Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg...

Method#[](*args) -> object (63376.0)

メソッドオブジェクトに封入されているメソッドを起動します。

メソッドオブジェクトに封入されているメソッドを起動します。

引数やブロックはそのままメソッドに渡されます。

self[] の形の呼び出しは通常のメソッド呼び出しに見た目を
近付けるためだけに用意されたもので、Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg...

Method#call(*args) -> object (63376.0)

メソッドオブジェクトに封入されているメソッドを起動します。

メソッドオブジェクトに封入されているメソッドを起動します。

引数やブロックはそのままメソッドに渡されます。

self[] の形の呼び出しは通常のメソッド呼び出しに見た目を
近付けるためだけに用意されたもので、Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg...

Method#call(*args) { ... } -> object (63376.0)

メソッドオブジェクトに封入されているメソッドを起動します。

メソッドオブジェクトに封入されているメソッドを起動します。

引数やブロックはそのままメソッドに渡されます。

self[] の形の呼び出しは通常のメソッド呼び出しに見た目を
近付けるためだけに用意されたもので、Array#[]のような
他の [] メソッドとの意味的な関連性はありません。


@param args self に渡される引数。

@see UnboundMethod#bind_call
@see spec/safelevel

//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg...

NoMethodError#args -> [object] (63349.0)

メソッド呼び出しに使われた引数を配列で返します。

メソッド呼び出しに使われた引数を配列で返します。

例:

begin
foobar(1,2,3)
rescue NoMethodError
p $!
p $!.name
p $!.args
end

# => #<NoMethodError: undefined method `foobar' for main:Object>
:foobar
[1, 2, 3]

絞り込み条件を変える

Method#curry -> Proc (63082.0)

self を元にカリー化した Proc を返します。

self を元にカリー化した Proc を返します。

カリー化した Proc はいくつかの引数をとります。十分な数の引数が与
えられると、元の Proc に引数を渡し て実行し、結果を返します。引数
の個数が足りないときは、部分適用したカリー化 Proc を返します。

@param arity 引数の個数を指定します。可変長の引数を指定できるメソッドを
カリー化する際には必ず指定する必要があります。

//emlist[例][ruby]{
def foo(a,b,c)
[a, b, c]
end

proc = self.method(:foo).curr...

Method#curry(arity) -> Proc (63082.0)

self を元にカリー化した Proc を返します。

self を元にカリー化した Proc を返します。

カリー化した Proc はいくつかの引数をとります。十分な数の引数が与
えられると、元の Proc に引数を渡し て実行し、結果を返します。引数
の個数が足りないときは、部分適用したカリー化 Proc を返します。

@param arity 引数の個数を指定します。可変長の引数を指定できるメソッドを
カリー化する際には必ず指定する必要があります。

//emlist[例][ruby]{
def foo(a,b,c)
[a, b, c]
end

proc = self.method(:foo).curr...

BasicObject#method_missing(name, *args) -> object (18670.0)

呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。

呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド
を呼び出します。

呼び出しに失敗したメソッドの名前 (Symbol) が name に
その時の引数が第二引数以降に渡されます。

デフォルトではこのメソッドは例外 NoMethodError を発生させます。


@param name 未定義メソッドの名前(シンボル)です。
@param args 未定義メソッドに渡された引数です。
@return ユーザー定義の method_missing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。

//emlist[例][ruby]{...

UnboundMethod#bind_call(recv, *args) -> object (9418.0)

self を recv に bind して args を引数として呼び出します。

self を recv に bind して args を引数として呼び出します。

self.bind(recv).call(*args) と同じ意味です。

//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}

@see UnboundMethod#bind, Method#call

UnboundMethod#bind_call(recv, *args) { ... } -> object (9418.0)

self を recv に bind して args を引数として呼び出します。

self を recv に bind して args を引数として呼び出します。

self.bind(recv).call(*args) と同じ意味です。

//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}

@see UnboundMethod#bind, Method#call

絞り込み条件を変える

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (1126.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

Object#to_enum(method = :each, *args) {|*args| ... } -> Enumerator (1126.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

Enumerator::Lazy#enum_for(method = :each, *args) {|*args| block} -> Enumerator::Lazy (940.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ...

Enumerator::Lazy#to_enum(method = :each, *args) {|*args| block} -> Enumerator::Lazy (940.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ...

Object#enum_for(method = :each, *args) -> Enumerator (826.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

絞り込み条件を変える

Object#to_enum(method = :each, *args) -> Enumerator (826.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

Module#ruby2_keywords(method_name, ...) -> nil (823.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument...

Enumerator::Lazy#enum_for(method = :each, *args) -> Enumerator::Lazy (640.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ...

Enumerator::Lazy#to_enum(method = :each, *args) -> Enumerator::Lazy (640.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ...

Enumerator#each(*args) -> Enumerator (484.0)

生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。

生成時のパラメータに従ってブロックを繰り返します。
*args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。
ブロック付きで呼び出された場合は、
生成時に指定したイテレータの戻り値をそのまま返します。

@param args 末尾へ追加する引数

//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"

enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } ...

絞り込み条件を変える

Enumerator#each(*args) {...} -> object (484.0)

生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。

生成時のパラメータに従ってブロックを繰り返します。
*args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。
ブロック付きで呼び出された場合は、
生成時に指定したイテレータの戻り値をそのまま返します。

@param args 末尾へ追加する引数

//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"

enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } ...

Object#send(name, *args) -> object (418.0)

オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。

オブジェクトのメソッド name を args を引数に
して呼び出し、メソッドの実行結果を返します。

ブロック付きで呼ばれたときはブロックもそのまま引き渡します。

send が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。

send, __send__ は、メソッドの呼び出し制限
にかかわらず任意のメソッドを呼び出せます。
d:spec/def#limit も参照してください。

public メソッドだけ呼び出せれば良い場合は
Object#public_send を使う...

Object#send(name, *args) { .... } -> object (418.0)

オブジェクトのメソッド name を args を引数に して呼び出し、メソッドの実行結果を返します。

オブジェクトのメソッド name を args を引数に
して呼び出し、メソッドの実行結果を返します。

ブロック付きで呼ばれたときはブロックもそのまま引き渡します。

send が再定義された場合に備えて別名 __send__ も
用意されており、ライブラリではこちらを使うべきです。また
__send__ は再定義すべきではありません。

send, __send__ は、メソッドの呼び出し制限
にかかわらず任意のメソッドを呼び出せます。
d:spec/def#limit も参照してください。

public メソッドだけ呼び出せれば良い場合は
Object#public_send を使う...

Module#class_exec(*args) {|*vars| ... } -> object (400.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

モジュールのコンテキストで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。

ローカル変数、定数とクラス変数のスコープはブロックの外側のスコープになります。

@param args ブロックに渡す引数を指定します。


//emlist[例][ruby]{
class Thing
end
c = 1

Thing.class_exec{
def hello()
"Hello there!"
...

Module#module_exec(*args) {|*vars| ... } -> object (400.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

モジュールのコンテキストで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。

ローカル変数、定数とクラス変数のスコープはブロックの外側のスコープになります。

@param args ブロックに渡す引数を指定します。


//emlist[例][ruby]{
class Thing
end
c = 1

Thing.class_exec{
def hello()
"Hello there!"
...

絞り込み条件を変える

Proc#ruby2_keywords -> proc (262.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked ...

Object#respond_to_missing?(symbol, include_private) -> bool (238.0)

自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。

自身が symbol で表されるメソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。

Object#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。

BasicObject#method_missing を override した場合にこのメソッドも
override されるべきです。

false を返します。

@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます...

Enumerator#each -> self (184.0)

生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。

生成時のパラメータに従ってブロックを繰り返します。
*args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。
ブロック付きで呼び出された場合は、
生成時に指定したイテレータの戻り値をそのまま返します。

@param args 末尾へ追加する引数

//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"

enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } ...

Enumerator#each {...} -> object (184.0)

生成時のパラメータに従ってブロックを繰り返します。 *args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。 ブロック付きで呼び出された場合は、 生成時に指定したイテレータの戻り値をそのまま返します。

生成時のパラメータに従ってブロックを繰り返します。
*args を渡した場合は、生成時のパラメータ内引数末尾へ *args を追加した状態で繰り返します。
ブロック付きで呼び出された場合は、
生成時に指定したイテレータの戻り値をそのまま返します。

@param args 末尾へ追加する引数

//emlist[例1][ruby]{
str = "Yet Another Ruby Hacker"

enum = Enumerator.new {|y| str.scan(/\w+/) {|w| y << w }}
enum.each {|word| p word } ...

RubyVM::InstructionSequence#to_a -> Array (46.0)

self の情報を 14 要素の配列にして返します。

self の情報を 14 要素の配列にして返します。

命令シーケンスを以下の情報で表します。

: magic

データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。

: major_version

命令シーケンスのメジャーバージョン。

: minor_version

命令シーケンスのマイナーバージョン。

: format_type

データフォーマットを示す数値。常に 1。

: misc

以下の要素から構成される Hash オブジェクト。

:arg_size: メソッド、ブ...

絞り込み条件を変える