Class: Watchr::FlayMetric::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/watchr/flay_metric/diff.rb

Constant Summary collapse

IDENTICAL =
:identical
SIMILAR =
:similar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(same, nodes, bonus, mass) ⇒ Diff

Returns a new instance of Diff.



10
11
12
13
14
15
16
# File 'lib/watchr/flay_metric/diff.rb', line 10

def initialize(same, nodes, bonus, mass)
  @locations = []
  @match = same ? IDENTICAL : SIMILAR
  @nodes = nodes
  @bonus = bonus
  @mass = mass
end

Instance Attribute Details

#bonusObject (readonly)

Returns the value of attribute bonus.



8
9
10
# File 'lib/watchr/flay_metric/diff.rb', line 8

def bonus
  @bonus
end

#codeObject

Returns the value of attribute code.



8
9
10
# File 'lib/watchr/flay_metric/diff.rb', line 8

def code
  @code
end

#locationsObject (readonly)

Returns the value of attribute locations.



8
9
10
# File 'lib/watchr/flay_metric/diff.rb', line 8

def locations
  @locations
end

#massObject (readonly)

Returns the value of attribute mass.



8
9
10
# File 'lib/watchr/flay_metric/diff.rb', line 8

def mass
  @mass
end

#matchObject (readonly)

Returns the value of attribute match.



8
9
10
# File 'lib/watchr/flay_metric/diff.rb', line 8

def match
  @match
end

#nodesObject (readonly)

Returns the value of attribute nodes.



8
9
10
# File 'lib/watchr/flay_metric/diff.rb', line 8

def nodes
  @nodes
end

Instance Method Details

#add_location(location) ⇒ Object



18
19
20
# File 'lib/watchr/flay_metric/diff.rb', line 18

def add_location(location)
  @locations << location
end