Class: Manipulation::Unifier

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_trail/manipulation/unifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pointsObject (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

#unifyObject



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