るりまサーチ

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

別のキーワード

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

クラス

キーワード

検索結果

Object#then {|x| ... } -> object (26237.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良...
...ソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件に...

Object#then -> Enumerator (26137.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良...
...ソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件に...

Object#yield_self {|x| ... } -> object (11137.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良...
...ソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件に...

Object#yield_self -> Enumerator (11037.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...を引数としてブロックを評価し、ブロックの結果を返します。

//emlist[例][ruby]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良...
...ソッドチェインのパイプライン][ruby]{
require 'open-uri'
require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件に...

Proc#===(*arg) -> () (8045.0)

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

...n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1
//}

また、以下のような syntactic sugar もあります。

//emlist[例][ruby]{
fib = lambda{|n|
case n
when 0 then 0
when 1 then 1
else
fi...

絞り込み条件を変える

Proc#[](*arg) -> () (8045.0)

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

...n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1
//}

また、以下のような syntactic sugar もあります。

//emlist[例][ruby]{
fib = lambda{|n|
case n
when 0 then 0
when 1 then 1
else
fi...

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

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

...n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1
//}

また、以下のような syntactic sugar もあります。

//emlist[例][ruby]{
fib = lambda{|n|
case n
when 0 then 0
when 1 then 1
else
fi...

Proc#yield(*arg) -> () (8045.0)

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

...n
when lambda{|n| n > 0} then 1
when lambda{|n| n < 0} then -1
else 0
end
end

p sign(-4) #=> -1
p sign(0) #=> 0
p sign(7) #=> 1
//}

また、以下のような syntactic sugar もあります。

//emlist[例][ruby]{
fib = lambda{|n|
case n
when 0 then 0
when 1 then 1
else
fi...