1118件ヒット
[1-100件を表示]
(0.060秒)
別のキーワード
種類
- インスタンスメソッド (987)
- 特異メソッド (108)
- モジュール関数 (23)
ライブラリ
クラス
-
ARGF
. class (126) - Addrinfo (12)
- Array (12)
- Complex (12)
- Dir (20)
- Enumerator (67)
-
Enumerator
:: ArithmeticSequence (28) -
Enumerator
:: Chain (28) -
Enumerator
:: Lazy (94) -
Etc
:: Group (12) - Float (24)
-
Gem
:: SourceIndex (12) - Hash (31)
- Integer (72)
- Numeric (24)
- Object (48)
- Pathname (23)
- Prime (24)
-
Prime
:: PseudoPrimeGenerator (36) - Range (59)
- Rational (24)
- String (80)
- StringIO (88)
-
Zlib
:: GzipReader (36)
モジュール
- Enumerable (48)
- Find (11)
- Kernel (12)
- TSort (55)
キーワード
- % (14)
- begin (7)
- bsearch (12)
- bytes (14)
- chars (14)
- codepoints (14)
- denominator (60)
- downto (12)
- each (146)
-
each
_ byte (48) -
each
_ char (36) -
each
_ child (8) -
each
_ codepoint (36) -
each
_ grapheme _ cluster (8) -
each
_ line (72) -
each
_ prime (12) -
each
_ strongly _ connected _ component (22) -
each
_ strongly _ connected _ component _ from (22) -
each
_ with _ index (24) - eager (6)
-
enum
_ for (48) - filter! (7)
- find (22)
- force (12)
- foreach (24)
- grep (12)
-
grep
_ v (10) -
group
_ by (12) - gsub (24)
- gsub! (12)
- hash (7)
- inspect (14)
-
keep
_ if (12) - lines (28)
-
max
_ by (24) - new (7)
- permutation (12)
-
reverse
_ each (2) - select! (12)
- size (26)
- step (19)
- times (12)
-
to
_ enum (48) -
tsort
_ each (11) - upto (12)
-
with
_ index (30) -
with
_ object (24)
検索結果
先頭5件
-
Integer
# numerator -> Integer (21213.0) -
分子(常に自身)を返します。
...分子(常に自身)を返します。
@return 分子を返します。
//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}
@see Integer#denominator... -
Numeric
# numerator -> Integer (18225.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
@see Numeric#denominator、Integer#numerator、Float#numerator、Rational#numerator、Complex#numerator... -
Rational
# numerator -> Integer (18225.0) -
分子を返します。
...分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
Rational(7).numerator # => 7
Rational(7, 1).numerator # => 7
Rational(9, -4).numerator # => -9
Rational(-2, -10).numerator # => 1
//}
@see Rational#denominator... -
Float
# numerator -> Integer (18213.0) -
自身を Rational に変換した時の分子を返します。
...自身を Rational に変換した時の分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}
@see Float#denominator... -
Enumerator
:: Lazy # eager -> Enumerator (9200.0) -
自身を遅延評価しない Enumerator に変換して返します。
...自身を遅延評価しない Enumerator に変換して返します。
//emlist[例][ruby]{
lazy_enum = (1..).each.lazy
# select が遅延評価されるので終了する
p lazy_enum.class # => Enumerator::Lazy
p lazy_enum.select { |n| n.even? }.first(5)
# => [2, 4, 6, 8, 10]
# select が遅......延評価されないので終了しない
enum = lazy_enum.eager
p enum.class # => Enumerator
p enum.select { |n| n.even? }.first(5)
//}... -
Enumerator
:: Lazy # grep(pattern) {|item| . . . } -> Enumerator :: Lazy (9200.0) -
Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINIT......Y).lazy.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}
@see Enumerable#grep......Y).lazy.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}
@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v... -
Enumerator
:: Lazy # grep _ v(pattern) {|item| . . . } -> Enumerator :: Lazy (9200.0) -
Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINIT......Y).lazy.map(&:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104", "105", "106", "107", "108", "109", "120", "123", "124", "125", "126", "127", "128"]
//}
@see Enumerable#grep_v, Enumerable#grep, Enumerator::Lazy#grep... -
Enumerator
:: ArithmeticSequence # begin -> Numeric (9100.0) -
初項 (始端) を返します。
...初項 (始端) を返します。
@see Enumerator::ArithmeticSequence#end... -
Enumerator
:: ArithmeticSequence # begin -> Numeric | nil (9100.0) -
初項 (始端) を返します。
...初項 (始端) を返します。
@see Enumerator::ArithmeticSequence#end... -
TSort
. each _ strongly _ connected _ component(each _ node , each _ child) -> Enumerator (6236.0) -
TSort.strongly_connected_components メソッドのイテレータ版です。
...TSort.strongly_connected_components メソッドのイテレータ版です。
引数 each_node と each_child でグラフを表します。
@param each_node グラフ上の頂点をそれぞれ評価するcallメソッドを持つオブ
ジェクトを指定します。
@param......][ruby]{
require 'tsort'
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }
# => [4]
# [2]
# [3]
# [1]
g = {1=>[2], 2=>[3, 4], 3=>[2......], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child = lambda {|n, &b| g[n].each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }
# => [4]
# [2, 3]
# [1]
//}
@see TSort#each_strongly_connected_component... -
String
# gsub(pattern) -> Enumerator (6201.0) -
文字列中で pattern にマッチした部分を順番にブロックに渡し、 その実行結果で置き換えた文字列を生成して返します。 ブロックなしの場合と違い、ブロックの中からは 組み込み変数 $1, $2, $3, ... を問題なく参照できます。
...表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@return 新しい文字列
//emlist[例][ruby]{
p 'abcabc'.gsub(/[bc]/) {|s| s.upcase } #=> "aBCaBC"
p 'abcabc'.gsub(/[bc]/) { $&.upcase } #=> "aBCaBC"
//}
@see String#sub, String#scan...