Class: PolarBear::Command::Batch

Inherits:
Object
  • Object
show all
Defined in:
lib/polarbear/command/batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Batch

Returns a new instance of Batch.



32
33
34
35
36
37
38
# File 'lib/polarbear/command/batch.rb', line 32

def initialize (options = nil)
  options = GlobalOptions.new if options == nil

  @command = {}
  @command[':batch-commands'] = {}
  @command[':batch-commands'][:'global-options'] = options.to_hash
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



30
31
32
# File 'lib/polarbear/command/batch.rb', line 30

def command
  @command
end

Instance Method Details

#add_command(command_name, hash) ⇒ Object



40
41
42
# File 'lib/polarbear/command/batch.rb', line 40

def add_command(command_name, hash)
  @command[':batch-commands'][command_name] = hash
end

#executeObject



44
45
46
# File 'lib/polarbear/command/batch.rb', line 44

def execute
  Admin.new.execute_batch(XmlFu.xml(@command))
end