別のキーワード
種類
- インスタンスメソッド (313)
- モジュール関数 (44)
- 特異メソッド (23)
- 文書 (12)
- クラス (11)
ライブラリ
- ビルトイン (347)
- csv (11)
-
rinda
/ rinda (11) -
rinda
/ tuplespace (22)
クラス
- Array (22)
- Enumerator (23)
-
Enumerator
:: Lazy (225) -
Rinda
:: TupleSpace (22) -
Rinda
:: TupleSpaceProxy (11)
モジュール
- Enumerable (33)
- ObjectSpace (44)
キーワード
- CSV (11)
-
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - chunk (22)
- collect (11)
-
drop
_ while (11) -
each
_ object (44) - filter (6)
-
filter
_ map (5) -
find
_ all (11) - grep (11)
-
grep
_ v (9) - lazy (11)
- map (11)
- new (18)
- notify (11)
- produce (5)
- reject (11)
- select (11)
-
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) -
take
_ while (66) -
with
_ index (10) - zip (11)
検索結果
先頭5件
-
Rinda
:: TupleSpaceProxy # take(tuple , sec = nil) -> Array | Hash (18326.0) -
tuple にマッチするタプルをタプルスペースから取り出して返します。
...オブジェクトの Rinda::TupleSpace#take にフォワードされます。
詳細は Rinda::TupleSpace#take を参照してください。
@param tuple タプルのパターン
@param sec タイムアウト秒数
@raise Rinda::RequestExpiredError take がタイムアウトした場合に発生......します
@raise Ridna::RequestCanceledError take が何らかの理由でキャンセルされた場合に発生します。... -
Rinda
:: TupleSpace # take(tuple , sec = nil) -> Array | Hash (18320.0) -
tuple にマッチするタプルをタプルスペースから取り出して返します。
...時には take をあきらめ
例外 Rinda::RequestExpiredError を発生させます。
sec に nil を指定するとタイムアウトせずに無限に待ち続けます。
@param tuple タプルのパターン
@param sec タイムアウト秒数
@raise Rinda::RequestExpiredError take がタ......イムアウトした場合に発生します
@raise Ridna::RequestCanceledError take が何らかの理由でキャンセルされた場合に発生します。... -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (6367.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"........"z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Array
# take _ while {|element| . . . } -> Array (6321.0) -
配列の要素を順に偽になるまでブロックで評価します。 最初に偽になった要素の手前の要素までを配列として返します。 このメソッドは自身を破壊的に変更しません。
...の要素までを配列として返します。
このメソッドは自身を破壊的に変更しません。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5, 0]
a.take_while {|i| i < 3 } # => [1, 2]
//}
ブロックを省略した場合は Enumerator を返します。
@see Enumerable#take_while... -
Enumerable
# take _ while {|element| . . . } -> Array (6321.0) -
Enumerable オブジェクトの要素を順に偽になるまでブロックで評価します。 最初に偽になった要素の手前の要素までを配列として返します。
...クで評価します。
最初に偽になった要素の手前の要素までを配列として返します。
//emlist[例][ruby]{
e = [1, 2, 3, 4, 5, 0].each
e.take_while {|i| i < 3 } # => [1, 2]
//}
ブロックを省略した場合は Enumerator を返します。
@see Array#take_while... -
Enumerator
:: Lazy # take _ while -> Enumerator :: Lazy (6267.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"........"z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Array
# take _ while -> Enumerator (6221.0) -
配列の要素を順に偽になるまでブロックで評価します。 最初に偽になった要素の手前の要素までを配列として返します。 このメソッドは自身を破壊的に変更しません。
...の要素までを配列として返します。
このメソッドは自身を破壊的に変更しません。
//emlist[例][ruby]{
a = [1, 2, 3, 4, 5, 0]
a.take_while {|i| i < 3 } # => [1, 2]
//}
ブロックを省略した場合は Enumerator を返します。
@see Enumerable#take_while... -
Enumerable
# take _ while -> Enumerator (6221.0) -
Enumerable オブジェクトの要素を順に偽になるまでブロックで評価します。 最初に偽になった要素の手前の要素までを配列として返します。
...クで評価します。
最初に偽になった要素の手前の要素までを配列として返します。
//emlist[例][ruby]{
e = [1, 2, 3, 4, 5, 0].each
e.take_while {|i| i < 3 } # => [1, 2]
//}
ブロックを省略した場合は Enumerator を返します。
@see Array#take_while... -
NEWS for Ruby 2
. 7 . 0 (414.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマ......ング
* CESU-8が追加されました。 15931
* Enumerable
* 新規メソッド
* Enumerable#filter_mapが追加されました。 15323
* Enumerable#tallyが追加されました。 11076
//emlist[Enumerable#filter_map][ruby]{
[1, 2, 3].filter_map {|x| x.odd? ? x.to_s :......ar baz)
e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager
p e.class #=> Enumerator
p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"]
//}
//emlist[Enumerator::Lazy#with_index][ruby]{
("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force
# => 1:a
#... -
NEWS for Ruby 3
. 0 . 0 (324.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...osplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 =>......mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in......ning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a RuntimeError is now raised (previously,
it only issued a warning in verbose mode).... -
NEWS for Ruby 3
. 1 . 0 (264.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...&)
end
//}
* ピン演算子に式を書けるようになりました。 17411
//emlist{
Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a
#=> [[3, 5], [5, 7], [11, 13]]
//}
* ピン演算子がインスタンス変数、クラス変数、グローバル変数をサポート......private def foo = puts "Hello" はパースされないことに注意してください。 17398
== コマンドラインオプション
* --disable-gems は"デバッグ専用"として明示的に宣言されました。デバッグ専用以外のコードでは使用しないでください......t: T
def initialize: (T output) -> void
end
//}
* ジェネリックな型エイリアスが定義できるようになりました。 https://github.com/ruby/rbs/pull/823
//emlist{
# Defines a generic type `list`.
type list[T] = [ T, list[T] ]
| nil
type str_list = list[String]...