Class: XCCache::YAMLRepresentable
- Inherits:
-
HashRepresentable
- Object
- HashRepresentable
- XCCache::YAMLRepresentable
- Defined in:
- lib/xccache/core/syntax/yml.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/yml.rb', line 6 def load YAML.safe_load(path.read) if path.exist? rescue StandardError {} end |
#save(to: nil) ⇒ Object
12 13 14 |
# File 'lib/xccache/core/syntax/yml.rb', line 12 def save(to: nil) (to || path).write(raw.to_yaml) end |