るりまサーチ

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

別のキーワード

  1. _builtin >>
  2. date >>
  3. ipaddr >>
  4. bn >>
  5. status >>

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

Date#next_year(n = 1) -> Date (7.0)

n 年後を返します。

...ます。

self >> (n * 12) に相当します。

//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}

Date#>> も参照し...

Enumerator::Lazy#chunk {|elt| ... } -> Enumerator::Lazy (7.0)

Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。

...

//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>

1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5]], [true, [6]], [false, [7, 8]]]
//}

@see Enumer...

Enumerator::Lazy#chunk(initial_state) {|elt, state| ... } -> Enumerator::Lazy (7.0)

Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。

...

//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>

1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5]], [true, [6]], [false, [7, 8]]]
//}

@see Enumer...

Enumerator::Lazy#slice_after {|elt| bool } -> Enumerator::Lazy (7.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

...//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#sl...

Enumerator::Lazy#slice_after(pattern) -> Enumerator::Lazy (7.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

...//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#sl...

絞り込み条件を変える

Enumerator::Lazy#slice_before {|elt| bool } -> Enumerator::Lazy (7.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice...

Enumerator::Lazy#slice_before(initial_state) {|elt, state| bool } -> Enumerator::Lazy (7.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice...

Enumerator::Lazy#slice_before(pattern) -> Enumerator::Lazy (7.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice...

Enumerator::Lazy#slice_when {|elt_before, elt_after| bool } -> Enumerator::Lazy (7.0)

Enumerable#slice_when と同じですが、配列ではなく Enumerator::Lazy を返します。

...][ruby]{
1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007fce84118348>:each>>

1.step.lazy.slice_when { |i, j| (i + j) % 5 == 0 }.take(5).force
# => [[1, 2], [3, 4, 5, 6, 7], [8, 9, 10, 11, 12], [13, 14, 15, 16, 17], [18, 19, 20...
<< < 1 2 3 4 5 ... > >>