Class: Watchr::FlayMetric::Diff

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Diff.



6
7
8
9
10
11
12
# File 'lib/watchr/metrics/flay/diff.rb', line 6

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.



4
5
6
# File 'lib/watchr/metrics/flay/diff.rb', line 4

def bonus
  @bonus
end

#codeObject

Returns the value of attribute code.



4
5
6
# File 'lib/watchr/metrics/flay/diff.rb', line 4

def code
  @code
end

#locationsObject (readonly)

Returns the value of attribute locations.



4
5
6
# File 'lib/watchr/metrics/flay/diff.rb', line 4

def locations
  @locations
end

#massObject (readonly)

Returns the value of attribute mass.



4
5
6
# File 'lib/watchr/metrics/flay/diff.rb', line 4

def mass
  @mass
end

#matchObject (readonly)

Returns the value of attribute match.



4
5
6
# File 'lib/watchr/metrics/flay/diff.rb', line 4

def match
  @match
end

#nodesObject (readonly)

Returns the value of attribute nodes.



4
5
6
# File 'lib/watchr/metrics/flay/diff.rb', line 4

def nodes
  @nodes
end

Instance Method Details

#add_location(location) ⇒ Object



14
15
16
# File 'lib/watchr/metrics/flay/diff.rb', line 14

def add_location(location)
  @locations << location
end