Class: Junkfood::Ceb::Executors::DelayedJobCommandExecutorJob
- Inherits:
-
Struct
- Object
- Struct
- Junkfood::Ceb::Executors::DelayedJobCommandExecutorJob
- Defined in:
- lib/junkfood/ceb/executors/delayed_job_command_executor.rb
Overview
The actual job class that is serialized for DelayedJob runs. which is tasked to perform the commands.
EXPERIMENTAL: This is untested, unfinished code.
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#perform ⇒ Object
This method JSON parses the command data, instantiating the referenced Command class, and finally executes the command.
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message
29 30 31 |
# File 'lib/junkfood/ceb/executors/delayed_job_command_executor.rb', line 29 def @message end |
Instance Method Details
#perform ⇒ Object
This method JSON parses the command data, instantiating the referenced Command class, and finally executes the command.
35 36 37 38 39 40 41 |
# File 'lib/junkfood/ceb/executors/delayed_job_command_executor.rb', line 35 def perform params = JSON.parse command_class = params['_type'].constantize raise 'err' unless .kind_of? ::Junkfood::Ceb::BaseCommand command = command_class.new params command.perform end |