るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.035秒)
トップページ > クラス:Range[x] > クエリ:Range#end[x] > 種類:特異メソッド[x]

別のキーワード

  1. range min
  2. range max
  3. net/http set_range
  4. httpheader set_range
  5. range step

ライブラリ

検索結果

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

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

...て返しま
す。

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

@param first 最初のオブジェクト
@param last 最後のオブジェクト
@param exclude_end 真をセットした場合終...
...mlist[例: 整数の範囲オブジェクトの場合][ruby]{
Range
.new(1, 10) # => 1..10
Range
.new(1, 10, true) # => 1...10
//}

//emlist[例: 日付オブジェクトの範囲オブジェクトの場合][ruby]{
require 'date'
Range
.new(Date.today, Date.today >> 1).each {|d| puts d }
# => 201...
...equire '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


def <=>(oth...