Class: Judges::Update::Churn
Overview
How many facts were modified.
Instance Attribute Summary collapse
-
#added ⇒ Object
readonly
Returns the value of attribute added.
-
#removed ⇒ Object
readonly
Returns the value of attribute removed.
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize(added, removed) ⇒ Churn
constructor
A new instance of Churn.
- #to_s ⇒ Object
- #zero? ⇒ Boolean
Constructor Details
#initialize(added, removed) ⇒ Churn
Returns a new instance of Churn.
79 80 81 82 |
# File 'lib/judges/commands/update.rb', line 79 def initialize(added, removed) @added = added @removed = removed end |
Instance Attribute Details
#added ⇒ Object (readonly)
Returns the value of attribute added.
77 78 79 |
# File 'lib/judges/commands/update.rb', line 77 def added @added end |
#removed ⇒ Object (readonly)
Returns the value of attribute removed.
77 78 79 |
# File 'lib/judges/commands/update.rb', line 77 def removed @removed end |
Instance Method Details
#+(other) ⇒ Object
92 93 94 |
# File 'lib/judges/commands/update.rb', line 92 def +(other) Churn.new(@added + other.added, @removed + other.removed) end |
#to_s ⇒ Object
84 85 86 |
# File 'lib/judges/commands/update.rb', line 84 def to_s "#{@added}/-#{@removed}" end |
#zero? ⇒ Boolean
88 89 90 |
# File 'lib/judges/commands/update.rb', line 88 def zero? @added.zero? && @removed.zero? end |