ライブラリ
クラス
- Array (24)
-
Benchmark
:: Job (2) -
Benchmark
:: Report (3) - Dir (1)
-
Enumerator
:: Lazy (11) - File (1)
-
Net
:: IMAP (1) -
Net
:: IMAP :: MailboxACLItem (2) -
OpenSSL
:: ASN1 :: Constructive (1) -
RSS
:: ImageItemModel :: ImageItem (14) -
RSS
:: Maker :: ItemsBase :: ItemBase (5) -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure (6) -
RSS
:: Maker :: RSS20 :: Items :: Item :: Guid (2) -
RSS
:: Maker :: RSS20 :: Items :: Item :: Source (2) -
RSS
:: RDF :: Channel (2) -
RSS
:: RDF :: Channel :: Items (1) -
RSS
:: Rss :: Channel (3) -
RSS
:: Rss :: Channel :: Item (23) -
RSS
:: Rss :: Channel :: Item :: Category (4) -
RSS
:: Rss :: Channel :: Item :: Enclosure (6) -
RSS
:: Rss :: Channel :: Item :: Guid (1) -
RSS
:: Rss :: Channel :: Item :: Source (4) - Range (2)
-
Shell
:: CommandProcessor (1) - WIN32OLE (1)
-
WIN32OLE
_ VARIANT (1)
モジュール
- Enumerable (48)
-
RSS
:: ImageItemModel (2)
キーワード
- Category (1)
- Enclosure (3)
- EnclosureBase (1)
- Guid (1)
- ImageItem (1)
- ImageItemModel (1)
- Items (1)
- MailboxACLItem (1)
- Source (1)
-
WIN32OLE
_ VARIANT (1) - []= (1)
- about (1)
- about= (1)
- all? (2)
- any? (2)
- categories (1)
- category (1)
- category= (1)
- chunk (1)
- collect (5)
- collect! (2)
-
collect
_ concat (1) - comments (1)
- comments= (1)
- content (2)
- content= (2)
- count (3)
- date (2)
- date= (2)
- description (1)
- description= (1)
- detect (2)
- domain (1)
- domain= (1)
-
drop
_ while (1) - each (4)
-
each
_ with _ index (2) - enclosure (2)
- enclosure= (1)
- find (2)
-
find
_ all (3) -
find
_ index (2) -
flat
_ map (1) - getacl (1)
- grep (3)
-
grep
_ v (2) - guid (1)
- guid= (1)
- height (1)
- height= (1)
-
image
_ height (1) -
image
_ height= (1) -
image
_ item (1) -
image
_ item= (1) -
image
_ width (1) -
image
_ width= (1) - index (2)
- inject (3)
- isPermaLink (2)
- isPermaLink= (1)
- item (3)
- item= (1)
- items (2)
- items= (1)
- join (2)
-
keep
_ if (1) - length (2)
- length= (2)
- link (2)
- link= (2)
- list (1)
- map (5)
- map! (2)
-
max
_ by (4) -
min
_ by (4) - new (1)
- partition (2)
- pubDate (1)
- pubDate= (1)
-
rb
_ ary _ delete (1) -
rb
_ ary _ includes (1) -
rb
_ ary _ push (1) -
rb
_ ary _ unshift (1) - reduce (3)
- reject (3)
- report (2)
- resource (1)
- resource= (1)
- resources (1)
-
reverse
_ each (1) - rights (1)
- rindex (2)
-
ruby 1
. 8 . 2 feature (1) - select (5)
- select! (2)
-
sort
_ by (2) -
sort
_ by! (1) - source (1)
- source= (1)
- step (1)
-
take
_ while (2) - title (2)
- title= (2)
- type (2)
- type= (2)
- uniq (2)
- uniq! (2)
- url (4)
- url= (4)
- user (1)
- width (1)
- width= (1)
検索結果
先頭5件
-
RSS
:: Rss :: Channel :: Item (72001.0) -
-
RSS
:: ImageItemModel # image _ item (63607.0) -
@todo
@todo -
RSS
:: ImageItemModel # image _ item= (63607.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # image _ width (63301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # image _ width= (63301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem (63001.0) -
-
RSS
:: Maker :: RSS20 :: Items :: Item :: Guid # isPermaLink (54601.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Guid # isPermaLink=() (54601.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # about (54301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # about= (54301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # date (54301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # date= (54301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # image _ height (54301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # image _ height= (54301.0) -
@todo
@todo -
Net
:: IMAP :: MailboxACLItem (54001.0) -
GETACL の応答の各要素を表すクラスです。
GETACL の応答の各要素を表すクラスです。
Net::IMAP#getacl の返り値として用いられます。
詳しくは 2086 を参照してください。 -
RSS
:: ImageItemModel (54001.0) -
-
RSS
:: ImageItemModel :: ImageItem # width (54001.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # width= (54001.0) -
@todo
@todo -
RSS
:: Maker :: ItemsBase :: ItemBase :: EnclosureBase (54001.0) -
-
Enumerator
:: Lazy # flat _ map {|item| . . . } -> Enumerator :: Lazy (46561.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。
* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) ... -
Enumerator
:: Lazy # collect _ concat {|item| . . . } -> Enumerator :: Lazy (46261.0) -
ブロックの実行結果をひとつに繋げたものに対してイテレートするような Enumerator::Lazy のインスタンスを返します。
ブロックの実行結果をひとつに繋げたものに対してイテレートするような
Enumerator::Lazy のインスタンスを返します。
//emlist[][ruby]{
["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force
#=> ["f", "o", "o", "b", "a", "r"]
//}
ブロックの返した値 x は、以下の場合にのみ分解され、連結されます。
* x が配列であるか、to_ary メソッドを持つとき
* x が each および force メソッドを持つ (例:Enumerator::Lazy) ... -
RSS
:: Rss :: Channel :: Item :: Guid # isPermaLink (45601.0) -
@todo
@todo
* http://purl.org/dc/elements/1.1/ -
RSS
:: Maker :: ItemsBase :: ItemBase # link (45301.0) -
@todo
@todo -
RSS
:: Maker :: ItemsBase :: ItemBase # link=() (45301.0) -
@todo
@todo -
RSS
:: Maker :: ItemsBase :: ItemBase # title (45301.0) -
@todo
@todo -
RSS
:: Maker :: ItemsBase :: ItemBase # title=() (45301.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure # length (45301.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure # length=() (45301.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure # url (45301.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure # url=() (45301.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Source # url (45301.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Source # url=() (45301.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # height (45001.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # height= (45001.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # resource (45001.0) -
@todo
@todo -
RSS
:: ImageItemModel :: ImageItem # resource= (45001.0) -
@todo
@todo -
RSS
:: Maker :: RSS09 :: Items :: Item :: Enclosure (45001.0) -
-
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure (45001.0) -
RSS 2.0を生成するときだけ利用されます.
RSS 2.0を生成するときだけ利用されます.
url,length,typeを設定する必要があります. -
VALUE rb
_ ary _ delete(VALUE ary , VALUE item) (38101.0) -
ary.delete
ary.delete -
VALUE rb
_ ary _ includes(ary , item) (37249.0) -
ary.include? item
ary.include? item -
Net
:: IMAP # getacl(mailbox) -> [Net :: IMAP :: MailboxACLItem] (37201.0) -
GETACL コマンドを送り、メールボックスの ACL(Access Control List) を取得します。
GETACL コマンドを送り、メールボックスの
ACL(Access Control List) を取得します。
Net::IMAP#getacl で指定したメールボックスに
対し何らかの権限を持つ各ユーザに対して
Net::IMAP::MailboxACLItem オブジェクトが
作られ、その配列が返されます。
GETACL コマンドは 2086 で定義されています。
詳しくはそちらを参照してください。
@param mailbox メールボックス名(文字列)
@see Net::IMAP::MailboxACLItem -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (36976.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.... -
Enumerable
# find _ all {|item| . . . } -> [object] (36907.0) -
各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。
各要素に対してブロックを評価した値が真であった要素を全て含む配列を
返します。真になる要素がひとつもなかった場合は空の配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]
[1,2,3,4,5].select # => #<E... -
Enumerator
:: Lazy # find _ all {|item| . . . } -> Enumerator :: Lazy (36907.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>
1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,... -
Enumerable
# all? {|item| . . . } -> bool (36904.0) -
すべての要素が真である場合に true を返します。 偽である要素があれば、ただちに false を返します。
すべての要素が真である場合に true を返します。
偽である要素があれば、ただちに false を返します。
ブロックを伴う場合は、各要素に対してブロックを評価し、すべての結果
が真である場合に true を返します。ブロックが偽を返した時点で、
ただちに false を返します。
自身に要素が存在しない場合は true を返します。
//emlist[例][ruby]{
require 'set'
# すべて正の数か?
p Set[5, 6, 7].all? {|v| v > 0 } # => true
p Set[5, -1, 7].all? {|v| v > 0... -
Enumerator
:: Lazy # take _ while -> Enumerator :: Lazy (36676.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.... -
Enumerable
# collect -> Enumerator (36607.0) -
各要素に対してブロックを評価した結果を全て含む配列を返します。
各要素に対してブロックを評価した結果を全て含む配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# すべて 3 倍にした配列を返す
p (1..3).map {|n| n * 3 } # => [3, 6, 9]
p (1..3).collect { "cat" } # => ["cat", "cat", "cat"]
//}
@see Array#collect, Array#map -
Enumerable
# collect {|item| . . . } -> [object] (36607.0) -
各要素に対してブロックを評価した結果を全て含む配列を返します。
各要素に対してブロックを評価した結果を全て含む配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# すべて 3 倍にした配列を返す
p (1..3).map {|n| n * 3 } # => [3, 6, 9]
p (1..3).collect { "cat" } # => ["cat", "cat", "cat"]
//}
@see Array#collect, Array#map -
Enumerable
# find _ all -> Enumerator (36607.0) -
各要素に対してブロックを評価した値が真であった要素を全て含む配列を 返します。真になる要素がひとつもなかった場合は空の配列を返します。
各要素に対してブロックを評価した値が真であった要素を全て含む配列を
返します。真になる要素がひとつもなかった場合は空の配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
(1..10).find_all # => #<Enumerator: 1..10:find_all>
(1..10).find_all { |i| i % 3 == 0 } # => [3, 6, 9]
[1,2,3,4,5].select # => #<E... -
Enumerable
# map {|item| . . . } -> [object] (36607.0) -
各要素に対してブロックを評価した結果を全て含む配列を返します。
各要素に対してブロックを評価した結果を全て含む配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# すべて 3 倍にした配列を返す
p (1..3).map {|n| n * 3 } # => [3, 6, 9]
p (1..3).collect { "cat" } # => ["cat", "cat", "cat"]
//}
@see Array#collect, Array#map -
Enumerable
# all? -> bool (36604.0) -
すべての要素が真である場合に true を返します。 偽である要素があれば、ただちに false を返します。
すべての要素が真である場合に true を返します。
偽である要素があれば、ただちに false を返します。
ブロックを伴う場合は、各要素に対してブロックを評価し、すべての結果
が真である場合に true を返します。ブロックが偽を返した時点で、
ただちに false を返します。
自身に要素が存在しない場合は true を返します。
//emlist[例][ruby]{
require 'set'
# すべて正の数か?
p Set[5, 6, 7].all? {|v| v > 0 } # => true
p Set[5, -1, 7].all? {|v| v > 0... -
Enumerable
# map -> Enumerator (36307.0) -
各要素に対してブロックを評価した結果を全て含む配列を返します。
各要素に対してブロックを評価した結果を全て含む配列を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# すべて 3 倍にした配列を返す
p (1..3).map {|n| n * 3 } # => [3, 6, 9]
p (1..3).collect { "cat" } # => ["cat", "cat", "cat"]
//}
@see Array#collect, Array#map -
RSS
:: Rss :: Channel # item (36307.0) -
@todo
@todo -
RSS
:: Rss :: Channel # item= (36307.0) -
@todo
@todo -
RSS
:: Maker :: ItemsBase :: ItemBase # enclosure (36301.0) -
@todo
@todo -
RSS
:: RDF :: Channel # items (36301.0) -
@todo
@todo -
RSS
:: RDF :: Channel # items= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel # items (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # author (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # author= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # categories (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # category (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # category= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # date (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # date= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # enclosure (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # enclosure= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # link (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # link= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # pubDate (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # pubDate= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # title (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item # title= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Category # domain (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Category # domain= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Enclosure # length (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Enclosure # length= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Enclosure # url (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Enclosure # url= (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Source # url (36301.0) -
@todo
@todo -
RSS
:: Rss :: Channel :: Item :: Source # url= (36301.0) -
@todo
@todo -
WIN32OLE
_ VARIANT (36055.0) -
OLEオートメーションの標準型のVARIANTオブジェクトをRubyで利用するための クラスです。
OLEオートメーションの標準型のVARIANTオブジェクトをRubyで利用するための
クラスです。
VARIANT型とは、型情報と値のペアから構成されるデータ型で、元はVBの型無し
変数のための構造体です。OLEオートメーションのメソッド呼び出しには汎用型
として引数にはVARIANT型を利用します。
* 型情報は、WIN32OLE_VARIANT#vartypeで取得できます。
* 値は、WIN32OLE_VARIANT#valueで取得できます。
OLEオートメーションのメソッド呼び出し規約では、引数はVARIANT型の配列と
して定義されています。
この規約に対して、WIN3... -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure # type (36001.0) -
@todo
@todo -
RSS
:: Maker :: RSS20 :: Items :: Item :: Enclosure # type=() (36001.0) -
@todo
@todo -
RSS
:: RDF :: Channel :: Items (36001.0) -
-
RSS
:: Rss :: Channel :: Item :: Category (36001.0) -
-
RSS
:: Rss :: Channel :: Item :: Enclosure (36001.0) -
-
Enumerable
# max _ by {|item| . . . } -> object | nil (28123.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
各要素を順番にブロックに渡して実行し、
その評価結果を <=> で比較して、
最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
引数を指定しない形式では要素が存在しなければ nil を返します。
引数を指定する形式では、空の配列を返します。
該当する要素が複数存在する場合、どの要素を返すかは不定です。
Enumerable#max と Enumerable#max_by の
違いは Enumerable#sort と Enumerable#sort_by の違いと同じです。
ブロックを省略した場合は Enumerator を返します。
@par... -
Array
# map! {|item| . . } -> self (27907.0) -
各要素を順番にブロックに渡して評価し、その結果で要素を 置き換えます。
各要素を順番にブロックに渡して評価し、その結果で要素を
置き換えます。
ブロックが与えられなかった場合は、自身と map! から生成した
Enumerator オブジェクトを返します。
//emlist[例][ruby]{
ary = [1, 2, 3]
ary.map! {|i| i * 3 }
p ary #=> [3, 6, 9]
ary = [1, 2, 3]
e = ary.map!
e.each{ 1 }
p ary #=> [1, 1, 1]
//}
@see Array#collect, Enumerator -
Enumerator
:: Lazy # collect {|item| . . . } -> Enumerator :: Lazy (27907.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>
1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,... -
Enumerator
:: Lazy # map {|item| . . . } -> Enumerator :: Lazy (27907.0) -
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>
1.step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8,... -
Enumerator
:: Lazy # select {|item| . . . } -> Enumerator :: Lazy (27907.0) -
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>
1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6,... -
Benchmark
:: Job # item(label = "") { . . . } -> self (27904.0) -
与えられたラベルとブロックをジョブリストに登録します。
与えられたラベルとブロックをジョブリストに登録します。
@param label ラベル -
Benchmark
:: Report # item(label = "" , *fmt) { . . . } -> Benchmark :: Tms (27904.0) -
ラベルと与えられたブロックの実行時間を標準出力に出力します。
ラベルと与えられたブロックの実行時間を標準出力に出力します。
出力のフォーマットは Benchmark::Tms#format が行います。
@param label ラベル
@param fmt 結果に出力したいオブジェクト
@see Benchmark::Tms#format -
Enumerable
# any? {|item| . . . } -> bool (27904.0) -
すべての要素が偽である場合に false を返します。 真である要素があれば、ただちに true を返します。
すべての要素が偽である場合に false を返します。
真である要素があれば、ただちに true を返します。
ブロックを伴う場合は、各要素に対してブロックを評価し、すべての結果
が偽である場合に false を返します。ブロックが真を返した時点
で、ただちに true を返します。
自身に要素が存在しない場合は false を返します。
//emlist[例][ruby]{
require 'set'
p Set[1, 2, 3].any? {|v| v > 3 } # => false
p Set[1, 2, 3].any? {|v| v > 1 } ... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (27904.0) -
要素とそのインデックスをブロックに渡して繰り返します。
要素とそのインデックスをブロックに渡して繰り返します。
ブロックを省略した場合は、
要素とそのインデックスを繰り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_with_index do |n, idx|
p [n, idx]
end
#... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (27904.0) -
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>
1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42, 43, 44, 45, 46, 47, 48, 49, 50, 51]
//... -
OpenSSL
:: ASN1 :: Constructive # each {|item| . . . } -> self (27904.0) -
構造型のデータに含まれる各要素に対してブロックを 評価します。
構造型のデータに含まれる各要素に対してブロックを
評価します。 -
Enumerable
# max _ by(n) {|item| . . . } -> Array (27823.0) -
各要素を順番にブロックに渡して実行し、 その評価結果を <=> で比較して、 最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
各要素を順番にブロックに渡して実行し、
その評価結果を <=> で比較して、
最大であった値に対応する元の要素、もしくは最大の n 要素が降順で入った配列を返します。
引数を指定しない形式では要素が存在しなければ nil を返します。
引数を指定する形式では、空の配列を返します。
該当する要素が複数存在する場合、どの要素を返すかは不定です。
Enumerable#max と Enumerable#max_by の
違いは Enumerable#sort と Enumerable#sort_by の違いと同じです。
ブロックを省略した場合は Enumerator を返します。
@par... -
Array
# select! -> Enumerator (27712.0) -
ブロックが真を返した要素を残し、偽を返した要素を自身から削除します。 変更があった場合は self を、 変更がなかった場合には nil を返します。
ブロックが真を返した要素を残し、偽を返した要素を自身から削除します。
変更があった場合は self を、
変更がなかった場合には nil を返します。
//emlist[例][ruby]{
a = %w{ a b c d e f }
a.select! {|v| v =~ /[a-z]/ } # => nil
a # => ["a", "b", "c", "d", "e", "f"]
//}
ブロックが与えられなかった場合は、自身と select! から生成した
Enumerator オブジェクトを返します。
@see Array#keep_if, Array#reject!