Class: AccessRange
- Inherits:
-
Range
- Object
- Range
- AccessRange
- Extended by:
- Enumerable
- Defined in:
- lib/accessrange.rb
Instance Attribute Summary collapse
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(min, max) ⇒ AccessRange
constructor
A new instance of AccessRange.
- #quick_iter ⇒ Object
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
#max ⇒ Object
Returns the value of attribute max.
4 5 6 |
# File 'lib/accessrange.rb', line 4 def max @max end |
#min ⇒ Object
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_iter ⇒ Object
15 16 17 |
# File 'lib/accessrange.rb', line 15 def quick_iter Range.new(@min, @max).each {|x| puts x} end |