るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.041秒)
トップページ > クエリ:date[x] > クエリ:convert[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. rss date=
  2. rss date
  3. date iso8601
  4. date rfc3339
  5. date jisx0301

クラス

キーワード

検索結果

Range#entries -> Array (32.0)

self を配列に変換します。

...=> [0, 1, 2, 3]
p ('a'..'c').to_a # => ["a", "b", "c"]
p (:a..:d).to_a # => [:a, :b, :c, :d]

require 'date'
p (Date.new(1965, 4, 14) .. Date.new(1965, 4, 14)).to_a # => [#<Date: 1965-04-14 ((2438865j,0s,0n),+0s,2299161j)>]

(1..).to_a # RangeError: cannot convert endless range to an array
//}...

Range#to_a -> Array (32.0)

self を配列に変換します。

...=> [0, 1, 2, 3]
p ('a'..'c').to_a # => ["a", "b", "c"]
p (:a..:d).to_a # => [:a, :b, :c, :d]

require 'date'
p (Date.new(1965, 4, 14) .. Date.new(1965, 4, 14)).to_a # => [#<Date: 1965-04-14 ((2438865j,0s,0n),+0s,2299161j)>]

(1..).to_a # RangeError: cannot convert endless range to an array
//}...