Class: CurationConcerns::Workflow::MethodGenerator
- Inherits:
-
Object
- Object
- CurationConcerns::Workflow::MethodGenerator
- Defined in:
- app/services/curation_concerns/workflow/method_generator.rb
Overview
Responsible for writing the database records for the given :action and :method list.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(action:, list:) ⇒ MethodGenerator
constructor
A new instance of MethodGenerator.
Constructor Details
#initialize(action:, list:) ⇒ MethodGenerator
Returns a new instance of MethodGenerator.
15 16 17 18 |
# File 'app/services/curation_concerns/workflow/method_generator.rb', line 15 def initialize(action:, list:) @action = action @list = list end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
20 21 22 |
# File 'app/services/curation_concerns/workflow/method_generator.rb', line 20 def action @action end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
20 21 22 |
# File 'app/services/curation_concerns/workflow/method_generator.rb', line 20 def list @list end |
Class Method Details
.call(action:, list:) ⇒ Object
9 10 11 |
# File 'app/services/curation_concerns/workflow/method_generator.rb', line 9 def self.call(action:, list:) new(action: action, list: list).call end |
Instance Method Details
#call ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/services/curation_concerns/workflow/method_generator.rb', line 22 def call if list.size < action.triggered_methods.count replace_list else update_list end end |