Class: Aruba::Platforms::UnixEnvironmentVariables::UpdateAction
- Inherits:
-
Object
- Object
- Aruba::Platforms::UnixEnvironmentVariables::UpdateAction
- Defined in:
- lib/aruba/platforms/unix_environment_variables.rb
Overview
Update environment
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#other_env ⇒ Object
readonly
Returns the value of attribute other_env.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(other_env, &block) ⇒ UpdateAction
constructor
A new instance of UpdateAction.
Constructor Details
#initialize(other_env, &block) ⇒ UpdateAction
Returns a new instance of UpdateAction.
11 12 13 14 15 |
# File 'lib/aruba/platforms/unix_environment_variables.rb', line 11 def initialize(other_env, &block) @other_env = other_env.to_h.transform_values(&:to_s) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
9 10 11 |
# File 'lib/aruba/platforms/unix_environment_variables.rb', line 9 def block @block end |
#other_env ⇒ Object (readonly)
Returns the value of attribute other_env.
9 10 11 |
# File 'lib/aruba/platforms/unix_environment_variables.rb', line 9 def other_env @other_env end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/aruba/platforms/unix_environment_variables.rb', line 17 def call(env) if block env.update(other_env, &block) else env.update(other_env) end end |