Class: IntervalNotation::SubtractCombiner
- Defined in:
- lib/interval_notation/combiners.rb
Instance Attribute Summary collapse
-
#include_last_point ⇒ Object
readonly
checks whether last passed point should be included.
Attributes inherited from Combiner
#num_interval_sets, #previous_state
Instance Method Summary collapse
-
#initialize ⇒ SubtractCombiner
constructor
A new instance of SubtractCombiner.
-
#state ⇒ Object
checks whether current section should be included.
Methods inherited from Combiner
Constructor Details
#initialize ⇒ SubtractCombiner
Returns a new instance of SubtractCombiner.
119 120 121 122 |
# File 'lib/interval_notation/combiners.rb', line 119 def initialize @include_last_point = nil @inside = [false, false] end |
Instance Attribute Details
#include_last_point ⇒ Object (readonly)
checks whether last passed point should be included
117 118 119 |
# File 'lib/interval_notation/combiners.rb', line 117 def include_last_point @include_last_point end |
Instance Method Details
#state ⇒ Object
checks whether current section should be included
125 126 127 |
# File 'lib/interval_notation/combiners.rb', line 125 def state @inside[0] && ! @inside[1] end |