Class: Envie::Env
- Inherits:
-
Object
- Object
- Envie::Env
- Defined in:
- lib/envie/env.rb
Instance Method Summary collapse
- #derive(child) ⇒ Object
- #features ⇒ Object
- #from(parent) ⇒ Object
- #has?(name) ⇒ Boolean
- #with(feature) ⇒ Object
Instance Method Details
#derive(child) ⇒ Object
17 18 19 |
# File 'lib/envie/env.rb', line 17 def derive(child) Envie.at(child).from(self) end |
#features ⇒ Object
4 5 6 |
# File 'lib/envie/env.rb', line 4 def features @features ||= [] end |
#from(parent) ⇒ Object
21 22 23 24 |
# File 'lib/envie/env.rb', line 21 def from(parent) @parent = parent self end |
#has?(name) ⇒ Boolean
13 14 15 |
# File 'lib/envie/env.rb', line 13 def has?(name) features.include?(name) || (@parent && @parent.has?(name)) end |
#with(feature) ⇒ Object
8 9 10 11 |
# File 'lib/envie/env.rb', line 8 def with(feature) features << feature self end |