Class: PolarBear::Command::Batch
- Inherits:
-
Object
- Object
- PolarBear::Command::Batch
- Defined in:
- lib/polarbear/command/batch.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #add_command(command_name, hash) ⇒ Object
- #execute ⇒ Object
-
#initialize(options = nil) ⇒ Batch
constructor
A new instance of Batch.
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 ( = nil) = GlobalOptions.new if == nil @command = {} @command[':batch-commands'] = {} @command[':batch-commands'][:'global-options'] = .to_hash end |
Instance Attribute Details
#command ⇒ Object (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 |
#execute ⇒ Object
44 45 46 |
# File 'lib/polarbear/command/batch.rb', line 44 def execute Admin.new.execute_batch(XmlFu.xml(@command)) end |