るりまサーチ

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

別のキーワード

  1. csv convert
  2. csv header_convert
  3. _builtin try_convert
  4. converter primitive_convert
  5. _builtin primitive_convert

ライブラリ

クラス

キーワード

検索結果

Range#to_a -> Array (15167.0)

self を配列に変換します。

...]{
p (5..0).to_a # => []
p (0..3).to_a # => [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 # RangeEr...

Range#entries -> Array (67.0)

self を配列に変換します。

...]{
p (5..0).to_a # => []
p (0..3).to_a # => [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 # RangeEr...

CSV::FieldInfo#line -> Integer (66.0)

行番号を返します。

...new("date1,date2,date3\n2018-07-09,2018-07-10\n2018-08-09,2018-08-10", headers: true)
csv.convert do |field,field_info|
p field_info.line
Date
.parse(field)
end
p csv.to_a

# => 2
# => 2
# => 3
# => 3
# => [#<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 201...
...8-07-10 ((2458310j,0s,0n),+0s,2299161j)> "date3":nil>, ...]
//}...

NEWS for Ruby 3.1.0 (18.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

.../}

* ピン演算子に式を書けるようになりました。 17411

//emlist{
Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a
#=> [[3, 5], [5, 7], [11, 13]]
//}

* ピン演算子がインスタンス変数、クラス変数、グローバル変数をサポートしま...
...10917
* GC.total_time が計測された時間をナノ秒で返します。 10917

* Integer
* 新規メソッド
* Integer.try_convert が追加されました。 15211

* Kernel
* 変更されたメソッド
* Kernel#load が第2引数にモジュールを渡せる...
...
* RubyGems 3.3.3
* base64 0.1.1
* benchmark 0.2.0
* bigdecimal 3.1.1
* bundler 2.3.3
* cgi 0.3.1
* csv 3.2.2
* date 3.2.2
* did_you_mean 1.6.1
* digest 3.1.0
* drb 2.1.0
* erb 2.2.3
* error_highlight 0.3.0
* etc 1.3.0
* fcntl 1.0.1...

ruby 1.6 feature (18.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby '-*' -v
=> ruby 1.6.7 (2002-03-01) [i586-linux]

=> ruby: invalid option -* (-h will show valid options)

: 2002-05-22 parsedate

バージョンアップ((<ruby-dev:17171>))

: 2002-05-22 -T オプション

ruby のコマンドラインオプション -T の後に空白...
...対して例外が発生していました。
((<ruby-bugs-ja:PR#114>))

p(-1[10000000000])

=> -:1:in `[]': bignum too big to convert into `int' (RangeError)
from -:1
ruby 1.6.5 (2001-09-19) [i586-linux]

=> ruby 1.6.5 (2001-11-01) [i586-linux]...
...Enumerable

def each(&block)
block.call(1,2)
block.call(2,3)
block.call(3,4)
end
end

x = X.new
p x.to_a #=> [[1], [2], [3]]

# => ruby 1.6.3 (2001-03-19) [i586-linux]
[[1], [2], [3]]

# => ruby 1.6.4 (2001-06-04) [i586-linux]...

絞り込み条件を変える