Class: Construi::Config::Global
- Inherits:
-
Object
- Object
- Construi::Config::Global
- Includes:
- Environment
- Defined in:
- lib/construi/config.rb
Instance Attribute Summary collapse
-
#yaml ⇒ Object
readonly
Returns the value of attribute yaml.
Instance Method Summary collapse
- #env ⇒ Object
-
#initialize(yaml) ⇒ Global
constructor
A new instance of Global.
- #target(target) ⇒ Object
Methods included from Environment
Methods included from Files
Methods included from Image
#build, #image, #image_configured, #image_configured?, #privileged?
Constructor Details
#initialize(yaml) ⇒ Global
Returns a new instance of Global.
79 80 81 |
# File 'lib/construi/config.rb', line 79 def initialize(yaml) @yaml = yaml end |
Instance Attribute Details
#yaml ⇒ Object (readonly)
Returns the value of attribute yaml.
77 78 79 |
# File 'lib/construi/config.rb', line 77 def yaml @yaml end |
Instance Method Details
#env ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/construi/config.rb', line 83 def env return [] if yaml['environment'].nil? yaml['environment'].reduce([]) do |acc, e| key = e.partition('=').first value = e.partition('=').last value = ENV[key] if value.empty? acc << "#{key}=#{value}" unless value.nil? or value.empty? acc end end |