Class: ZAWS::External::AWSCLI::Commands::AWS

Inherits:
Object
  • Object
show all
Defined in:
lib/zaws/external/awscli/commands/aws.rb

Instance Method Summary collapse

Constructor Details

#initialize(subcommand = nil) ⇒ AWS

Returns a new instance of AWS.



6
7
8
9
10
11
# File 'lib/zaws/external/awscli/commands/aws.rb', line 6

def initialize(subcommand=nil)
  @subcommand=subcommand
  @output=nil
  @region=nil
  self
end

Instance Method Details

#get_commandObject



28
29
30
31
32
33
34
# File 'lib/zaws/external/awscli/commands/aws.rb', line 28

def get_command
  command = "aws "
  command = "#{command}--output #{@output} " if @output
  command = "#{command}--region #{@region} " if @region
  command = "#{command}#{@subcommand.get_command}" if @subcommand
  return command.strip
end

#output(output) ⇒ Object



13
14
15
16
# File 'lib/zaws/external/awscli/commands/aws.rb', line 13

def output(output)
  @output=output
  self
end

#region(region) ⇒ Object



18
19
20
21
# File 'lib/zaws/external/awscli/commands/aws.rb', line 18

def region(region)
  @region=region
  self
end

#subcommand(subcommand) ⇒ Object



23
24
25
26
# File 'lib/zaws/external/awscli/commands/aws.rb', line 23

def subcommand(subcommand)
  @subcommand=subcommand
  self
end