Class: IntervalNotation::BasicIntervals::OpenOpenInterval
- Inherits:
-
Object
- Object
- IntervalNotation::BasicIntervals::OpenOpenInterval
show all
- Includes:
- ActslikeInterval
- Defined in:
- lib/interval_notation/basic_intervals.rb
Instance Method Summary
collapse
#closure, #deep_include_position?, #eql?, #finite?, #from_finite?, #from_to_s, #hash, included, #inspect, #length, #singular_point?, #to_finite?, #to_interval_set, #to_to_s
Constructor Details
Returns a new instance of OpenOpenInterval.
59
60
61
62
63
|
# File 'lib/interval_notation/basic_intervals.rb', line 59
def initialize(from, to)
raise Error, "Interval (#{from};#{to}) can't be created" unless from < to
@from = from
@to = to
end
|
Instance Method Details
#==(other) ⇒ Object
68
|
# File 'lib/interval_notation/basic_intervals.rb', line 68
def ==(other); other.is_a?(OpenOpenInterval) && from == other.from && to == other.to; end
|
#include_from? ⇒ Boolean
65
|
# File 'lib/interval_notation/basic_intervals.rb', line 65
def include_from?; false; end
|
#include_position?(value) ⇒ Boolean
67
|
# File 'lib/interval_notation/basic_intervals.rb', line 67
def include_position?(value); from < value && value < to; end
|
#include_to? ⇒ Boolean
66
|
# File 'lib/interval_notation/basic_intervals.rb', line 66
def include_to?; false; end
|
#interval_boundaries(interval_index) ⇒ Object
69
70
71
72
|
# File 'lib/interval_notation/basic_intervals.rb', line 69
def interval_boundaries(interval_index)
[ BoundaryPoint.new(from, false, true, interval_index, true),
BoundaryPoint.new(to, false, false, interval_index, true) ]
end
|
#to_s ⇒ Object
64
|
# File 'lib/interval_notation/basic_intervals.rb', line 64
def to_s; "(#{from_to_s};#{to_to_s})"; end
|