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.
      13 14 15 16 17  | 
    
      # File 'lib/aruba/platforms/unix_environment_variables.rb', line 13 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.
      11 12 13  | 
    
      # File 'lib/aruba/platforms/unix_environment_variables.rb', line 11 def block @block end  | 
  
#other_env ⇒ Object (readonly)
Returns the value of attribute other_env.
      11 12 13  | 
    
      # File 'lib/aruba/platforms/unix_environment_variables.rb', line 11 def other_env @other_env end  | 
  
Instance Method Details
#call(env) ⇒ Object
      19 20 21 22 23 24 25  | 
    
      # File 'lib/aruba/platforms/unix_environment_variables.rb', line 19 def call(env) if block env.update(other_env, &block) else env.update(other_env) end end  |