Class: EacConfig::YamlFileNode
- Inherits:
-
Object
- Object
- EacConfig::YamlFileNode
show all
- Includes:
- Node
- Defined in:
- lib/eac_config/yaml_file_node.rb,
lib/eac_config/yaml_file_node/entry.rb,
lib/eac_config/yaml_file_node/self_entries.rb
Defined Under Namespace
Classes: Entry, SelfEntries
Instance Attribute Summary
Attributes included from Node
#write_node
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Node
context, #entries, #entry, #load_path, #recursive_loaded_nodes, #self_entry, #self_entry_class, #self_loaded_nodes, #with_prefix
Class Method Details
.from_uri(uri) ⇒ Object
12
13
14
|
# File 'lib/eac_config/yaml_file_node.rb', line 12
def from_uri(uri)
new(uri.to_addressable.path) if uri.to_addressable.scheme == 'file'
end
|
Instance Method Details
#persist_data(new_data) ⇒ Object
33
34
35
36
37
|
# File 'lib/eac_config/yaml_file_node.rb', line 33
def persist_data(new_data)
path.parent.mkpath
::EacRubyUtils::Yaml.dump_file(path, new_data)
unmemoize(:data)
end
|
#to_s ⇒ Object
43
44
45
|
# File 'lib/eac_config/yaml_file_node.rb', line 43
def to_s
"#{self.class}[#{path}]"
end
|
#url ⇒ Object
39
40
41
|
# File 'lib/eac_config/yaml_file_node.rb', line 39
def url
::Addressable::URI.parse("file://#{path.expand_path}")
end
|