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 39 |
# 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 @command[':batch-commands'].compare_by_identity 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
41 42 43 |
# File 'lib/polarbear/command/batch.rb', line 41 def add_command(command_name, hash) @command[':batch-commands'][":#{command_name}"] = hash end |
#execute ⇒ Object
45 46 47 |
# File 'lib/polarbear/command/batch.rb', line 45 def execute Admin.new.execute_batch(Gyoku.xml(@command)) end |