Class: NodeTaskAcceptance
- Inherits:
-
Object
- Object
- NodeTaskAcceptance
- Defined in:
- app/services/node_task_acceptance.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #accept! ⇒ Object
-
#initialize(node:) ⇒ NodeTaskAcceptance
constructor
A new instance of NodeTaskAcceptance.
- #reject! ⇒ Object
Constructor Details
#initialize(node:) ⇒ NodeTaskAcceptance
Returns a new instance of NodeTaskAcceptance.
6 7 8 |
# File 'app/services/node_task_acceptance.rb', line 6 def initialize(node:) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
4 5 6 |
# File 'app/services/node_task_acceptance.rb', line 4 def node @node end |
Instance Method Details
#accept! ⇒ Object
10 11 12 13 |
# File 'app/services/node_task_acceptance.rb', line 10 def accept! @node.update!(accept_new_tasks: true) RunTasksForAllExecutionTypesJob.perform_later end |
#reject! ⇒ Object
15 16 17 |
# File 'app/services/node_task_acceptance.rb', line 15 def reject! @node.update!(accept_new_tasks: false) end |