Class: Plug::TaskExecutionService
- Inherits:
-
Object
- Object
- Plug::TaskExecutionService
- Defined in:
- app/services/plug/task_execution_service.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name: nil) ⇒ TaskExecutionService
constructor
A new instance of TaskExecutionService.
Constructor Details
#initialize(name: nil) ⇒ TaskExecutionService
Returns a new instance of TaskExecutionService.
9 10 11 12 13 |
# File 'app/services/plug/task_execution_service.rb', line 9 def initialize(name: nil) raise 'Task name is required' if name.nil? @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'app/services/plug/task_execution_service.rb', line 7 def name @name end |
Instance Method Details
#call ⇒ Object
15 16 17 18 |
# File 'app/services/plug/task_execution_service.rb', line 15 def call Rails.application.load_tasks Rake::Task[name].execute end |