Class: IntervalNotation::SubtractCombiner

Inherits:
Combiner
  • Object
show all
Defined in:
lib/interval_notation/combiners.rb

Instance Attribute Summary collapse

Attributes inherited from Combiner

#num_interval_sets, #previous_state

Instance Method Summary collapse

Methods inherited from Combiner

#pass

Constructor Details

#initializeSubtractCombiner

Returns a new instance of SubtractCombiner.



73
74
75
76
# File 'lib/interval_notation/combiners.rb', line 73

def initialize
  @include_last_point = nil
  @inside = [false, false]
end

Instance Attribute Details

#include_last_pointObject (readonly)

checks whether last passed point should be included



71
72
73
# File 'lib/interval_notation/combiners.rb', line 71

def include_last_point
  @include_last_point
end

Instance Method Details

#stateObject

checks whether current section should be included



79
80
81
# File 'lib/interval_notation/combiners.rb', line 79

def state
  @inside[0] && ! @inside[1]
end