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.
7 8 9 10 11 |
# File 'app/services/plug/task_execution_service.rb', line 7 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.
5 6 7 |
# File 'app/services/plug/task_execution_service.rb', line 5 def name @name end |
Instance Method Details
#call ⇒ Object
13 14 15 16 |
# File 'app/services/plug/task_execution_service.rb', line 13 def call Rails.application.load_tasks Rake::Task[name].execute end |