Class: Envie::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/envie/env.rb

Instance Method Summary collapse

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

#featuresObject



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

Returns:

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