Class: NKJ::RangeTable
- Inherits:
-
Object
- Object
- NKJ::RangeTable
- Defined in:
- lib/nkj/range_table.rb
Instance Attribute Summary collapse
-
#ranges ⇒ Object
readonly
Returns the value of attribute ranges.
Instance Method Summary collapse
- #include?(value) ⇒ Boolean
-
#initialize(*ranges) ⇒ RangeTable
constructor
A new instance of RangeTable.
Constructor Details
#initialize(*ranges) ⇒ RangeTable
Returns a new instance of RangeTable.
7 8 9 |
# File 'lib/nkj/range_table.rb', line 7 def initialize(*ranges) @ranges = ranges end |
Instance Attribute Details
#ranges ⇒ Object (readonly)
Returns the value of attribute ranges.
5 6 7 |
# File 'lib/nkj/range_table.rb', line 5 def ranges @ranges end |
Instance Method Details
#include?(value) ⇒ Boolean
11 12 13 |
# File 'lib/nkj/range_table.rb', line 11 def include?(value) ranges.any? { |r| r.include?(value) } end |