Class: Hyrax::Workflow::MethodGenerator
- Inherits:
-
Object
- Object
- Hyrax::Workflow::MethodGenerator
- Defined in:
- app/services/hyrax/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.
16 17 18 19 |
# File 'app/services/hyrax/workflow/method_generator.rb', line 16 def initialize(action:, list:) @action = action @list = list end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
21 22 23 |
# File 'app/services/hyrax/workflow/method_generator.rb', line 21 def action @action end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
21 22 23 |
# File 'app/services/hyrax/workflow/method_generator.rb', line 21 def list @list end |
Class Method Details
.call(action:, list:) ⇒ Object
10 11 12 |
# File 'app/services/hyrax/workflow/method_generator.rb', line 10 def self.call(action:, list:) new(action: action, list: list).call end |
Instance Method Details
#call ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/services/hyrax/workflow/method_generator.rb', line 23 def call if list.size < action.triggered_methods.count replace_list else update_list end end |