23件ヒット
[1-23件を表示]
(0.024秒)
検索結果
-
Range
# entries -> Array (39113.0) -
self を配列に変換します。
...self を配列に変換します。
@raise RangeError 終端のない Range オブジェクトを変換しようとしたときに発生します。
//emlist[例][ruby]{
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 # RangeError: cannot convert endless range to an array
//}... -
Range
# to _ a -> Array (24013.0) -
self を配列に変換します。
...self を配列に変換します。
@raise RangeError 終端のない Range オブジェクトを変換しようとしたときに発生します。
//emlist[例][ruby]{
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 # RangeError: cannot convert endless range to an array
//}... -
ruby 1
. 8 . 3 feature (42.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...2 -e 'p ("x".taint[1..-1]).tainted?'
false
$ ruby-1.8.3 -e 'p ("x".taint[1..-1]).tainted?'
true
Range オブジェクトが taint されている場合、"string"[range] も taint されるようになりました。((<ruby-dev:27121>))
$ ruby-1.8.2 -e 'p ("x"[(0..-1).taint]......] [bug]
: Dir#entries [ruby] [bug]
1回メソッドを呼んでしまうと空になるバグを修正しました。
$ ruby-1.8.2 -e '
d = Dir.new("/")
d.entries
p d.entries
'
[]
$ ruby-1.8.3 -e '
d = Dir.new("/")
d.entries
p d.entries
'
["....