Class: AccessRange

Inherits:
Range
  • Object
show all
Extended by:
Enumerable
Defined in:
lib/accessrange.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(min, max) ⇒ AccessRange

Returns a new instance of AccessRange.



6
7
8
9
# File 'lib/accessrange.rb', line 6

def initialize(min, max)
  @min = min
  @max = max
end

Instance Attribute Details

#maxObject

Returns the value of attribute max.



4
5
6
# File 'lib/accessrange.rb', line 4

def max
  @max
end

#minObject

Returns the value of attribute min.



4
5
6
# File 'lib/accessrange.rb', line 4

def min
  @min
end

Instance Method Details

#each(&block) ⇒ Object



11
12
13
# File 'lib/accessrange.rb', line 11

def each(&block)
  Range.new(@min, @max).each(&block)
end

#quick_iterObject



15
16
17
# File 'lib/accessrange.rb', line 15

def quick_iter
   Range.new(@min, @max).each {|x| puts x}
end