Module: EacConfig::Node
- Includes:
- Memoized
- Included in:
- EnvvarsNode, PrefixedPathNode, YamlFileNode
- Defined in:
- lib/eac_config/node.rb
Instance Attribute Summary collapse
-
#write_node ⇒ Object
Returns the value of attribute write_node.
Class Method Summary collapse
Instance Method Summary collapse
- #entries(path) ⇒ Array<EacConfig::Entries>
- #entry(path) ⇒ Object
- #load_path ⇒ [EacConfig::IncludePath]
- #recursive_loaded_nodes ⇒ Array<EacConfig::Node>
-
#self_entry(path) ⇒ EacConfig::NodeEntry
Return a entry which search values only in the self node.
- #self_entry_class ⇒ Object
- #self_loaded_nodes ⇒ Array<EacConfig::Node>
- #url ⇒ Addressable::URI
- #with_prefix(path_prefix) ⇒ EacConfig::PrefixedPathNode
Instance Attribute Details
#write_node ⇒ Object
Returns the value of attribute write_node.
13 14 15 |
# File 'lib/eac_config/node.rb', line 13 def write_node @write_node end |
Class Method Details
.context ⇒ Object
8 9 10 |
# File 'lib/eac_config/node.rb', line 8 def context @context ||= ::EacRubyUtils::Context.new end |
Instance Method Details
#entries(path) ⇒ Array<EacConfig::Entries>
21 22 23 |
# File 'lib/eac_config/node.rb', line 21 def entries(path) ::EacConfig::Entries.new(self, path) end |
#entry(path) ⇒ Object
25 26 27 |
# File 'lib/eac_config/node.rb', line 25 def entry(path) ::EacConfig::Entry.new(self, path) end |
#load_path ⇒ [EacConfig::IncludePath]
30 31 32 |
# File 'lib/eac_config/node.rb', line 30 def load_path @load_path ||= ::EacConfig::LoadPath.new(self) end |
#recursive_loaded_nodes ⇒ Array<EacConfig::Node>
55 56 57 |
# File 'lib/eac_config/node.rb', line 55 memoize def recursive_loaded_nodes ::EacConfig::LoadNodesSearch.new(self).result end |
#self_entry(path) ⇒ EacConfig::NodeEntry
Return a entry which search values only in the self node.
41 42 43 |
# File 'lib/eac_config/node.rb', line 41 def self_entry(path) self_entry_class.new(self, path) end |
#self_entry_class ⇒ Object
45 46 47 |
# File 'lib/eac_config/node.rb', line 45 def self_entry_class self.class.const_get('Entry') end |
#self_loaded_nodes ⇒ Array<EacConfig::Node>
50 51 52 |
# File 'lib/eac_config/node.rb', line 50 def self_loaded_nodes load_path.paths.flat_map { |node_path| load_nodes(node_path) } end |
#url ⇒ Addressable::URI
35 36 37 |
# File 'lib/eac_config/node.rb', line 35 def url raise_abstract_method(__method__) end |
#with_prefix(path_prefix) ⇒ EacConfig::PrefixedPathNode
60 61 62 |
# File 'lib/eac_config/node.rb', line 60 def with_prefix(path_prefix) ::EacConfig::PrefixedPathNode.new(self, path_prefix) end |