るりまサーチ

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

別のキーワード

  1. _builtin call
  2. fiddle call
  3. method call
  4. formatter call
  5. continuation call

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...


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

@
see UnboundMethod#bind_call
@
see spec/safelevel

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

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called...

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

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

...


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

@
see UnboundMethod#bind_call
@
see spec/safelevel

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

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called...

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

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

...せん。


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

@
see UnboundMethod#bind_call

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

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2...

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

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

...せん。


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

@
see UnboundMethod#bind_call

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

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2...

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

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

...りません。


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

@
see spec/safelevel

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

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
/...

絞り込み条件を変える

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

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

...りません。


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

@
see spec/safelevel

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

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # => "foo called with arg 1"
m.call(2) # => "foo called with arg 2"
/...

Proc#call(*arg) -> () (15115.0)

手続きオブジェクトを実行してその結果を返します。

...|
case n
when 0 then 0
when 1 then 1
else
fib.(n - 2) + fib.(n - 1)
end
}
fib.(10) # => 55
//}



@
param arg 手続きオブジェクトに与える引数を指定します。

@
raise LocalJumpError Procを生成したメソッドからリターンしてしまった場合に発生し...

Kernel.#syscall(num, *arg) -> Integer (6132.0)

numで指定された番号のシステムコールを実行します。 第2引数以降をシステムコールの引数として渡します。

...て渡します。

どの数値がどのシステムコールに対応するかは、
syscall(2) や
/usr/include/sys/syscall.h を参照してください。

システムコールの慣習に従い、syscall(2)
が -1 を返す場合には例外 Errno::EXXX が発生します。
それ以外で...
...高レベルな操作ができます。

@
param num システムコール番号です。
@
param arg 文字列か、整数です。最大 9 個まで渡すことができます。
@
raise Errno::EXXX syscall(2) が -1 を返した場合に発生します。
@
raise NotImplementedError 実行環境が...
...このメソッドに対応していないとき発生します。

//emlist[例][ruby]{
syscall 4, 1, "hello\n", 6 # '4' is write(2) on our box
# => hello
//}

@
see fiddle, syscall(2freebsd), syscall(2linux)...

UnboundMethod#bind_call(recv, *args) -> object (6128.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 (6128.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...

絞り込み条件を変える

Kernel.#caller(range) -> [String] | nil (6126.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。

トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した...
...ます。

@
param start long の範囲を超えない正の整数でスタックレベルを指定します。
@
param length 取得するスタックの個数を指定します。

@
param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。

@
see Kernel.#...
...set_trace_func,Kernel.#raise,
Kernel.#caller_locations

//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:...

Kernel.#caller(start = 1) -> [String] | nil (6126.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。

トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した...
...ます。

@
param start long の範囲を超えない正の整数でスタックレベルを指定します。
@
param length 取得するスタックの個数を指定します。

@
param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。

@
see Kernel.#...
...set_trace_func,Kernel.#raise,
Kernel.#caller_locations

//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:...

Kernel.#caller(start, length) -> [String] | nil (6126.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。

トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した...
...ます。

@
param start long の範囲を超えない正の整数でスタックレベルを指定します。
@
param length 取得するスタックの個数を指定します。

@
param range 取得したいスタックの範囲を示す Range オブジェクトを指定します。

@
see Kernel.#...
...set_trace_func,Kernel.#raise,
Kernel.#caller_locations

//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:in `bar'", "-:13:in `<main>'"]
# ["-:13:...

Kernel.#caller_locations(range) -> [Thread::Backtrace::Location] | nil (6126.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...す。引
数で指定した値が範囲外の場合は nil を返します。

@
param start 開始フレームの位置を数値で指定します。

@
param length 取得するフレームの個数を指定します。

@
param range 取得したいフレームの範囲を示す Range オブジェ...
...y]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

call
er_locations # => []
test3(1, nil)
# => ["...
...(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}

@
see Thread::Backtrace::Location, Kernel.#caller...

Kernel.#caller_locations(start = 1, length = nil) -> [Thread::Backtrace::Location] | nil (6126.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...す。引
数で指定した値が範囲外の場合は nil を返します。

@
param start 開始フレームの位置を数値で指定します。

@
param length 取得するフレームの個数を指定します。

@
param range 取得したいフレームの範囲を示す Range オブジェ...
...y]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

call
er_locations # => []
test3(1, nil)
# => ["...
...(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}

@
see Thread::Backtrace::Location, Kernel.#caller...

絞り込み条件を変える

<< 1 2 3 ... > >>