Module: Yew::Utils
- Defined in:
- lib/yew.rb
Class Method Summary collapse
-
.fetch(key, env, root) ⇒ Yew::Tree, Object
Fetches the key’s value.
-
.raw_fetch(key, env, root) ⇒ Object
Fetches a value from the env.
Class Method Details
.fetch(key, env, root) ⇒ Yew::Tree, Object
Fetches the key’s value.
Returns a tree if the value is a hash. Otherwise it returns the raw value.
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/yew.rb', line 71 def self.fetch(key, env, root) value = raw_fetch(key, env, root) if value.is_a?(Hash) path = key path = "#{root}.#{path}" if root Tree.new(value, path) else value end end |