Class: Producer::Core::Env
- Inherits:
-
Baf::Env
- Object
- Baf::Env
- Producer::Core::Env
- Extended by:
- Forwardable
- Defined in:
- lib/producer/core/env.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#output_error ⇒ Object
readonly
Returns the value of attribute output_error.
-
#recipe_argv ⇒ Object
Returns the value of attribute recipe_argv.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
- #[](*args) ⇒ Object (also: #get)
- #cleanup ⇒ Object
-
#initialize(remote: nil, registry: {}, **opts) ⇒ Env
constructor
A new instance of Env.
- #log(message, severity = :info) ⇒ Object
- #remote ⇒ Object
Constructor Details
#initialize(remote: nil, registry: {}, **opts) ⇒ Env
Returns a new instance of Env.
10 11 12 13 14 |
# File 'lib/producer/core/env.rb', line 10 def initialize remote: nil, registry: {}, **opts super **opts @remote = remote @registry = registry end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
7 8 9 |
# File 'lib/producer/core/env.rb', line 7 def input @input end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
7 8 9 |
# File 'lib/producer/core/env.rb', line 7 def logger @logger end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/producer/core/env.rb', line 7 def output @output end |
#output_error ⇒ Object (readonly)
Returns the value of attribute output_error.
7 8 9 |
# File 'lib/producer/core/env.rb', line 7 def output_error @output_error end |
#recipe_argv ⇒ Object
Returns the value of attribute recipe_argv.
8 9 10 |
# File 'lib/producer/core/env.rb', line 8 def recipe_argv @recipe_argv end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
7 8 9 |
# File 'lib/producer/core/env.rb', line 7 def registry @registry end |
Instance Method Details
#[](*args) ⇒ Object Also known as: get
20 21 22 23 24 |
# File 'lib/producer/core/env.rb', line 20 def [] *args @registry.fetch *args rescue KeyError raise RegistryKeyError, args.first.inspect end |
#cleanup ⇒ Object
38 39 40 |
# File 'lib/producer/core/env.rb', line 38 def cleanup remote.cleanup end |
#log(message, severity = :info) ⇒ Object
34 35 36 |
# File 'lib/producer/core/env.rb', line 34 def log , severity = :info logger.send severity, end |