Class: Migsupo::Differ::Diff
- Inherits:
-
Object
- Object
- Migsupo::Differ::Diff
- Defined in:
- lib/migsupo/differ/diff.rb
Instance Attribute Summary collapse
-
#operations ⇒ Object
readonly
Returns the value of attribute operations.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(operations: []) ⇒ Diff
constructor
A new instance of Diff.
- #to_s ⇒ Object
Constructor Details
#initialize(operations: []) ⇒ Diff
Returns a new instance of Diff.
6 7 8 9 |
# File 'lib/migsupo/differ/diff.rb', line 6 def initialize(operations: []) @operations = operations.freeze freeze end |
Instance Attribute Details
#operations ⇒ Object (readonly)
Returns the value of attribute operations.
4 5 6 |
# File 'lib/migsupo/differ/diff.rb', line 4 def operations @operations end |
Instance Method Details
#empty? ⇒ Boolean
11 12 13 |
# File 'lib/migsupo/differ/diff.rb', line 11 def empty? @operations.empty? end |
#to_s ⇒ Object
15 16 17 18 19 |
# File 'lib/migsupo/differ/diff.rb', line 15 def to_s return "No changes." if empty? @operations.map(&:to_s).join("\n") end |