Class: XCCache::JSONRepresentable
- Inherits:
-
HashRepresentable
- Object
- HashRepresentable
- XCCache::JSONRepresentable
- Defined in:
- lib/xccache/core/syntax/json.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from HashRepresentable
Instance Method Summary collapse
Methods inherited from HashRepresentable
#[], #[]=, #initialize, #merge!
Constructor Details
This class inherits a constructor from XCCache::HashRepresentable
Instance Method Details
#load ⇒ Object
6 7 8 9 10 |
# File 'lib/xccache/core/syntax/json.rb', line 6 def load JSON.parse(path.read) if path.exist? rescue StandardError {} end |
#save(to: nil) ⇒ Object
12 13 14 |
# File 'lib/xccache/core/syntax/json.rb', line 12 def save(to: nil) (to || path).write(JSON.pretty_generate(raw)) end |