るりまサーチ

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

別のキーワード

  1. _builtin last
  2. array last
  3. range last
  4. regexp last_match
  5. fiddle last_error

検索結果

Range.new(first, last, exclude_end = false) -> Range (18299.0)

first から last までの範囲オブジェクトを生成して返しま す。

...first から last までの範囲オブジェクトを生成して返しま
す。

exclude_end が真ならば終端を含まない範囲オブジェクトを生
成します。exclude_end 省略時には終端を含みます。

@param first 最初のオブジェクト
@param last 最後のオブ...
...st <=> last が nil の場合に発生します

//emlist[例: 整数の範囲オブジェクトの場合][ruby]{
Range
.new(1, 10) # => 1..10
Range
.new(1, 10, true) # => 1...10
//}

//emlist[例: 日付オブジェクトの範囲オブジェクトの場合][ruby]{
require 'date'
Range
.new(Date...
...[ruby]{
require 'ipaddr'
Range
.new(IPAddr.new("192.0.2.1"), IPAddr.new("192.0.2.3")).each {|ip| puts ip}
# => 192.0.2.1
# 192.0.2.2
# 192.0.2.3
//}

//emlist[例: 自作のオブジェクトの場合][ruby]{
MyInteger = Struct.new(:value) do
def succ
self.class.new(value + 1)
end

de...