Module: RubyFly::Commands::Mixins::Environment

Included in:
DestroyPipeline, GetPipeline, Login, SetPipeline, Status, UnpausePipeline
Defined in:
lib/ruby_fly/commands/mixins/environment.rb

Instance Method Summary collapse

Instance Method Details

#configure_command(builder, opts) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ruby_fly/commands/mixins/environment.rb', line 15

def configure_command(builder, opts)
  builder = super(builder, opts)
  environment = opts[:environment] || @environment
  if environment
    builder = environment.to_a
        .inject(builder) do |b, environment_variable|
      b.with_environment_variable(*environment_variable)
    end
  end
  builder
end

#for_environment(environment) ⇒ Object



10
11
12
13
# File 'lib/ruby_fly/commands/mixins/environment.rb', line 10

def for_environment(environment)
  @environment = environment
  self
end

#initialize(opts = {}) ⇒ Object



5
6
7
8
# File 'lib/ruby_fly/commands/mixins/environment.rb', line 5

def initialize(opts = {})
  super(opts)
  @environment = opts[:environment]
end