Module: EacConfig::Node

Includes:
Memoized
Included in:
EnvvarsNode, PrefixedPathNode, YamlFileNode
Defined in:
lib/eac_config/node.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#write_nodeObject

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

.contextObject



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>

Returns:



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]

Returns:

  • ([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_nodesArray<EacConfig::Node>

Returns:



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_classObject



45
46
47
# File 'lib/eac_config/node.rb', line 45

def self_entry_class
  self.class.const_get('Entry')
end

#self_loaded_nodesArray<EacConfig::Node>

Returns:



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

#urlAddressable::URI

Returns:

  • (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