Class: AwesomeExplain::Queue::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/awesome_explain/queue/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_name, event, object) ⇒ Command

Returns a new instance of Command.



7
8
9
10
11
# File 'lib/awesome_explain/queue/command.rb', line 7

def initialize(method_name, event, object)
  @method_name = method_name
  @event = event
  @object = object
end

Instance Attribute Details

#event=(value) ⇒ Object (writeonly)

Sets the attribute event

Parameters:

  • value

    the value to set the attribute event to.



4
5
6
# File 'lib/awesome_explain/queue/command.rb', line 4

def event=(value)
  @event = value
end

#method_name=(value) ⇒ Object (writeonly)

Sets the attribute method_name

Parameters:

  • value

    the value to set the attribute method_name to.



3
4
5
# File 'lib/awesome_explain/queue/command.rb', line 3

def method_name=(value)
  @method_name = value
end

#object=(value) ⇒ Object (writeonly)

Sets the attribute object

Parameters:

  • value

    the value to set the attribute object to.



5
6
7
# File 'lib/awesome_explain/queue/command.rb', line 5

def object=(value)
  @object = value
end

Instance Method Details

#runObject



13
14
15
# File 'lib/awesome_explain/queue/command.rb', line 13

def run
  object.send method_name, event
end