Module: Anvil::Helpers
Instance Method Summary collapse
- #anvil_metadata_dir(root) ⇒ Object
- #json_decode(str) ⇒ Object
- #json_encode(obj) ⇒ Object
- #read_anvil_metadata(root, name) ⇒ Object
- #write_anvil_metadata(root, name, data) ⇒ Object
Instance Method Details
#anvil_metadata_dir(root) ⇒ Object
14 15 16 17 18 |
# File 'lib/anvil/helpers.rb', line 14 def (root) dir = File.join(root, ".anvil") FileUtils.mkdir_p(dir) dir end |
#json_decode(str) ⇒ Object
10 11 12 |
# File 'lib/anvil/helpers.rb', line 10 def json_decode(str) JSON.load(str) end |
#json_encode(obj) ⇒ Object
6 7 8 |
# File 'lib/anvil/helpers.rb', line 6 def json_encode(obj) JSON.dump(obj) end |