Class: RailsWorkflow::Config
- Inherits:
-
Object
- Object
- RailsWorkflow::Config
- Includes:
- Singleton
- Defined in:
- lib/rails_workflow.rb
Instance Attribute Summary collapse
-
#operation_types ⇒ Object
Returns the value of attribute operation_types.
-
#sidekiq_enabled ⇒ Object
Returns the value of attribute sidekiq_enabled.
Instance Method Summary collapse
- #assignment_by ⇒ Object
- #assignment_by=(assignment) ⇒ Object
- #default_operation_template_type ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #manager_class ⇒ Object
- #manager_class=(value) ⇒ Object
- #operation_template_klass=(value) ⇒ Object
- #process_class ⇒ Object
- #process_class=(value) ⇒ Object
- #process_template_klass=(value) ⇒ Object
- #process_template_type ⇒ Object
- #sql_dialect ⇒ Object
- #sql_dialect=(dialect) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rails_workflow.rb', line 20 def initialize @default_operation_types = { default: { title: "Default Operation", class: "RailsWorkflow::Operation" }, user_role: { title: "Operation for User By Role", class: "RailsWorkflow::UserByRoleOperation" }, user_group: { title: "Operation by User Group", class: "RailsWorkflow::UserByGroupOperation" } } @default_operation_template_type = "RailsWorkflow::OperationTemplate" @default_process_manager = "RailsWorkflow::ProcessManager" @default_process_class = "RailsWorkflow::Process" @default_process_template_type = "RailsWorkflow::ProcessTemplate" @default_assignment_by = [:group, :role] @default_sql_dialect = 'pg' end |
Instance Attribute Details
#operation_types ⇒ Object
Returns the value of attribute operation_types.
17 18 19 |
# File 'lib/rails_workflow.rb', line 17 def operation_types @operation_types end |
#sidekiq_enabled ⇒ Object
Returns the value of attribute sidekiq_enabled.
18 19 20 |
# File 'lib/rails_workflow.rb', line 18 def sidekiq_enabled @sidekiq_enabled end |
Instance Method Details
#assignment_by ⇒ Object
57 58 59 |
# File 'lib/rails_workflow.rb', line 57 def assignment_by @assignment_by || @default_assignment_by end |
#assignment_by=(assignment) ⇒ Object
61 62 63 |
# File 'lib/rails_workflow.rb', line 61 def assignment_by=(assignment) @assignment_by = assignment end |
#default_operation_template_type ⇒ Object
73 74 75 |
# File 'lib/rails_workflow.rb', line 73 def default_operation_template_type @operation_template_type || @default_operation_template_type end |
#manager_class ⇒ Object
81 82 83 |
# File 'lib/rails_workflow.rb', line 81 def manager_class @process_manager || @default_process_manager end |
#manager_class=(value) ⇒ Object
77 78 79 |
# File 'lib/rails_workflow.rb', line 77 def manager_class=(value) @process_manager = value end |
#operation_template_klass=(value) ⇒ Object
69 70 71 |
# File 'lib/rails_workflow.rb', line 69 def operation_template_klass=(value) @operation_template_type = value end |
#process_class ⇒ Object
93 94 95 |
# File 'lib/rails_workflow.rb', line 93 def process_class @process_class || @default_process_class end |
#process_class=(value) ⇒ Object
85 86 87 |
# File 'lib/rails_workflow.rb', line 85 def process_class=(value) @process_class = value end |
#process_template_klass=(value) ⇒ Object
89 90 91 |
# File 'lib/rails_workflow.rb', line 89 def process_template_klass=(value) @process_template_type = value end |
#process_template_type ⇒ Object
97 98 99 |
# File 'lib/rails_workflow.rb', line 97 def process_template_type @process_template_type || @default_process_template_type end |
#sql_dialect ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/rails_workflow.rb', line 44 def sql_dialect case @sql_dialect || @default_sql_dialect when 'pg' RailsWorkflow::Db::Pg when 'mysql' RailsWorkflow::Db::Mysql end end |
#sql_dialect=(dialect) ⇒ Object
53 54 55 |
# File 'lib/rails_workflow.rb', line 53 def sql_dialect=(dialect) @sql_dialect = dialect end |