Class: Backburner::RemoteCommand
- Inherits:
-
Object
- Object
- Backburner::RemoteCommand
- Defined in:
- lib/backburner/remote_command.rb
Instance Attribute Summary collapse
-
#command_stack ⇒ Object
Returns the value of attribute command_stack.
Instance Method Summary collapse
- #flatten ⇒ Object
-
#initialize(command_name, connection, command_stack = nil) ⇒ RemoteCommand
constructor
A new instance of RemoteCommand.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(command_name, connection, command_stack = nil) ⇒ RemoteCommand
Returns a new instance of RemoteCommand.
5 6 7 8 9 |
# File 'lib/backburner/remote_command.rb', line 5 def initialize command_name, connection, command_stack=nil @command_stack = command_stack || [] @command_stack.unshift command_name @connection = connection end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
11 12 13 |
# File 'lib/backburner/remote_command.rb', line 11 def method_missing method_name, *args self.class.new method_name, @command_stack end |
Instance Attribute Details
#command_stack ⇒ Object
Returns the value of attribute command_stack.
3 4 5 |
# File 'lib/backburner/remote_command.rb', line 3 def command_stack @command_stack end |
Instance Method Details
#flatten ⇒ Object
15 16 17 |
# File 'lib/backburner/remote_command.rb', line 15 def flatten @command_stack.join ' ' end |