Class: Watchr::FlayMetric::Diff
- Inherits:
-
Object
- Object
- Watchr::FlayMetric::Diff
- Defined in:
- lib/watchr/metrics/flay/diff.rb
Instance Attribute Summary collapse
-
#bonus ⇒ Object
readonly
Returns the value of attribute bonus.
-
#code ⇒ Object
Returns the value of attribute code.
-
#locations ⇒ Object
readonly
Returns the value of attribute locations.
-
#mass ⇒ Object
readonly
Returns the value of attribute mass.
-
#match ⇒ Object
readonly
Returns the value of attribute match.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #add_location(location) ⇒ Object
-
#initialize(same, nodes, bonus, mass) ⇒ Diff
constructor
A new instance of Diff.
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
#bonus ⇒ Object (readonly)
Returns the value of attribute bonus.
4 5 6 |
# File 'lib/watchr/metrics/flay/diff.rb', line 4 def bonus @bonus end |
#code ⇒ Object
Returns the value of attribute code.
4 5 6 |
# File 'lib/watchr/metrics/flay/diff.rb', line 4 def code @code end |
#locations ⇒ Object (readonly)
Returns the value of attribute locations.
4 5 6 |
# File 'lib/watchr/metrics/flay/diff.rb', line 4 def locations @locations end |
#mass ⇒ Object (readonly)
Returns the value of attribute mass.
4 5 6 |
# File 'lib/watchr/metrics/flay/diff.rb', line 4 def mass @mass end |
#match ⇒ Object (readonly)
Returns the value of attribute match.
4 5 6 |
# File 'lib/watchr/metrics/flay/diff.rb', line 4 def match @match end |
#nodes ⇒ Object (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 |