Module: Construi::Config::WrappedYaml
- Included in:
- BuildEnvironment, Links::Link
- Defined in:
- lib/construi/config.rb
Instance Method Summary collapse
- #get(key, default = nil) ⇒ Object
- #key?(key) ⇒ Boolean
- #parent ⇒ Object
- #with_parent(or_else = nil) ⇒ Object
Instance Method Details
#get(key, default = nil) ⇒ Object
14 15 16 |
# File 'lib/construi/config.rb', line 14 def get(key, default = nil) key?(key) ? yaml[key.to_s] : default end |
#key?(key) ⇒ Boolean
10 11 12 |
# File 'lib/construi/config.rb', line 10 def key?(key) yaml.is_a?(Hash) && yaml.key?(key.to_s) end |
#parent ⇒ Object
6 7 8 |
# File 'lib/construi/config.rb', line 6 def parent nil end |
#with_parent(or_else = nil) ⇒ Object
18 19 20 |
# File 'lib/construi/config.rb', line 18 def with_parent(or_else = nil) parent ? yield(parent) : or_else end |