Class: TypedEnums::Output::Writer::Result
- Inherits:
-
Data
- Object
- Data
- TypedEnums::Output::Writer::Result
- Defined in:
- lib/typed_enums/output/writer/result.rb
Instance Attribute Summary collapse
-
#changed ⇒ Object
readonly
Returns the value of attribute changed.
-
#conflicts ⇒ Object
readonly
Returns the value of attribute conflicts.
-
#extra ⇒ Object
readonly
Returns the value of attribute extra.
-
#missing ⇒ Object
readonly
Returns the value of attribute missing.
-
#unchanged ⇒ Object
readonly
Returns the value of attribute unchanged.
Instance Method Summary collapse
Instance Attribute Details
#changed ⇒ Object (readonly)
Returns the value of attribute changed
6 7 8 |
# File 'lib/typed_enums/output/writer/result.rb', line 6 def changed @changed end |
#conflicts ⇒ Object (readonly)
Returns the value of attribute conflicts
6 7 8 |
# File 'lib/typed_enums/output/writer/result.rb', line 6 def conflicts @conflicts end |
#extra ⇒ Object (readonly)
Returns the value of attribute extra
6 7 8 |
# File 'lib/typed_enums/output/writer/result.rb', line 6 def extra @extra end |
#missing ⇒ Object (readonly)
Returns the value of attribute missing
6 7 8 |
# File 'lib/typed_enums/output/writer/result.rb', line 6 def missing @missing end |
#unchanged ⇒ Object (readonly)
Returns the value of attribute unchanged
6 7 8 |
# File 'lib/typed_enums/output/writer/result.rb', line 6 def unchanged @unchanged end |
Instance Method Details
#applied_summary ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/typed_enums/output/writer/result.rb', line 26 def applied_summary { "created" => missing, "updated" => changed, "removed" => extra }.filter_map do |label, files| "#{label}: #{files.join(', ')}" if files.any? end.join("\n") end |
#conflict? ⇒ Boolean
11 12 13 |
# File 'lib/typed_enums/output/writer/result.rb', line 11 def conflict? conflicts.any? end |
#stale? ⇒ Boolean
7 8 9 |
# File 'lib/typed_enums/output/writer/result.rb', line 7 def stale? changed.any? || missing.any? || extra.any? || conflicts.any? end |
#summary ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/typed_enums/output/writer/result.rb', line 15 def summary { "conflicts" => conflicts, "missing" => missing, "changed" => changed, "extra" => extra }.filter_map do |label, files| "#{label}: #{files.join(', ')}" if files.any? end.join("\n") end |