Class: NKJ::RangeTable

Inherits:
Object
  • Object
show all
Defined in:
lib/nkj/range_table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rangesObject (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

Returns:

  • (Boolean)


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

def include?(value)
  ranges.any? { |r| r.include?(value) }
end