Class: Hephaestus::Actions::ExpandJson

Inherits:
Object
  • Object
show all
Defined in:
lib/hephaestus/actions.rb

Instance Method Summary collapse

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