Class: EacConfig::NodeUri::InstanciateSingle
- Inherits:
-
Object
- Object
- EacConfig::NodeUri::InstanciateSingle
- Defined in:
- lib/eac_config/node_uri/instanciate_single.rb
Instance Method Summary collapse
Instance Method Details
#available_node_classes ⇒ Array<Class>
11 12 13 14 15 |
# File 'lib/eac_config/node_uri/instanciate_single.rb', line 11 def available_node_classes require 'eac_config/envvars_node' require 'eac_config/yaml_file_node' [::EacConfig::EnvvarsNode, ::EacConfig::YamlFileNode] end |
#result ⇒ EacConfig::Node
18 19 20 21 |
# File 'lib/eac_config/node_uri/instanciate_single.rb', line 18 def result available_node_classes.lazy.map { |k| k.from_uri(self) }.find(&:present?) || raise("No class mapped for \"#{to_addressable}\"") end |
#to_addressable ⇒ Addressable::URI
24 25 26 |
# File 'lib/eac_config/node_uri/instanciate_single.rb', line 24 def to_addressable instance_uri.to_uri end |