Class: EacConfig::YamlFileNode

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/eac_config/yaml_file_node.rb

Instance Method Summary collapse

Methods included from Node

#entry, #load_path, #recursive_loaded_nodes, #self_entry, #self_loaded_nodes

Instance Method Details

#dataObject



16
17
18
# File 'lib/eac_config/yaml_file_node.rb', line 16

def data
  @data ||= ::EacRubyUtils::Yaml.load_file(assert_path)
end

#persist_data(new_data) ⇒ Object



20
21
22
23
24
# File 'lib/eac_config/yaml_file_node.rb', line 20

def persist_data(new_data)
  path.parent.mkpath
  ::EacRubyUtils::Yaml.dump_file(path, new_data)
  reset_cache(:data)
end

#urlObject



26
27
28
# File 'lib/eac_config/yaml_file_node.rb', line 26

def url
  ::Addressable::URI.parse("file://#{path.expand_path}")
end