Class: Backburner::RemoteCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/backburner/remote_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_stackObject

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

#flattenObject



15
16
17
# File 'lib/backburner/remote_command.rb', line 15

def flatten
  @command_stack.join ' '
end