Class: Hephaestus::Actions::ExpandJson
- Inherits:
-
Object
- Object
- Hephaestus::Actions::ExpandJson
- Defined in:
- lib/hephaestus/actions.rb
Instance Method Summary collapse
-
#initialize(destination_root, file, data) ⇒ ExpandJson
constructor
A new instance of ExpandJson.
- #invoke! ⇒ Object
- #revoke! ⇒ Object
Constructor Details
#initialize(destination_root, file, data) ⇒ ExpandJson
Returns a new instance of ExpandJson.
66 67 68 69 70 |
# File 'lib/hephaestus/actions.rb', line 66 def initialize(destination_root, file, data) @destination_root = destination_root @file = file @data = data end |
Instance Method Details
#invoke! ⇒ Object
72 73 74 |
# File 'lib/hephaestus/actions.rb', line 72 def invoke! write_out { |existing_json| existing_json.deep_merge(data) } end |
#revoke! ⇒ Object
76 77 78 |
# File 'lib/hephaestus/actions.rb', line 76 def revoke! write_out { |existing_json| hash_unmerge(existing_json, data) } end |