Class: Manipulation::Unifier
- Inherits:
-
Object
- Object
- Manipulation::Unifier
- Defined in:
- lib/simple_trail/manipulation/unifier.rb
Instance Attribute Summary collapse
-
#unified_points ⇒ Object
readonly
Returns the value of attribute unified_points.
Instance Method Summary collapse
-
#initialize(points, old_points) ⇒ Unifier
constructor
A new instance of Unifier.
- #unify ⇒ Object
Constructor Details
#initialize(points, old_points) ⇒ Unifier
Returns a new instance of Unifier.
7 8 9 10 |
# File 'lib/simple_trail/manipulation/unifier.rb', line 7 def initialize(points, old_points) @points = points @old_points = old_points end |
Instance Attribute Details
#unified_points ⇒ Object (readonly)
Returns the value of attribute unified_points.
5 6 7 |
# File 'lib/simple_trail/manipulation/unifier.rb', line 5 def unified_points @unified_points end |
Instance Method Details
#unify ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/simple_trail/manipulation/unifier.rb', line 12 def unify @unified_points = [] average_point_location.each do |apl| possible_match = match_with_previous(apl) @unified_points << possible_match.nil? ? apl : possible_match end end |