Class: Reactor::Tools::WorkflowGenerator
- Inherits:
-
Object
- Object
- Reactor::Tools::WorkflowGenerator
- Defined in:
- lib/reactor/tools/workflow_generator.rb
Instance Attribute Summary collapse
-
#correctors ⇒ Object
readonly
Returns the value of attribute correctors.
-
#editors ⇒ Object
readonly
Returns the value of attribute editors.
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
-
#users ⇒ Object
readonly
Returns the value of attribute users.
-
#workflow_name ⇒ Object
readonly
Returns the value of attribute workflow_name.
Instance Method Summary collapse
- #destroy! ⇒ Object
- #generate! ⇒ Object
-
#initialize(options) ⇒ WorkflowGenerator
constructor
A new instance of WorkflowGenerator.
- #personal_group(user) ⇒ Object
Constructor Details
#initialize(options) ⇒ WorkflowGenerator
Returns a new instance of WorkflowGenerator.
6 7 8 9 10 11 12 13 14 |
# File 'lib/reactor/tools/workflow_generator.rb', line 6 def initialize() @editors = [:editors] @correctors = [:correctors] @users = @editors + @correctors @groups = personal_groups(@users) @class_name = [:obj_class] || generate_obj_class_name @workflow_name = [:workflow_name] || generate_workflow_name @obj_name = [:obj_name] || generate_obj_name end |
Instance Attribute Details
#correctors ⇒ Object (readonly)
Returns the value of attribute correctors.
4 5 6 |
# File 'lib/reactor/tools/workflow_generator.rb', line 4 def correctors @correctors end |
#editors ⇒ Object (readonly)
Returns the value of attribute editors.
4 5 6 |
# File 'lib/reactor/tools/workflow_generator.rb', line 4 def editors @editors end |
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
4 5 6 |
# File 'lib/reactor/tools/workflow_generator.rb', line 4 def groups @groups end |
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
4 5 6 |
# File 'lib/reactor/tools/workflow_generator.rb', line 4 def obj @obj end |
#users ⇒ Object (readonly)
Returns the value of attribute users.
4 5 6 |
# File 'lib/reactor/tools/workflow_generator.rb', line 4 def users @users end |
#workflow_name ⇒ Object (readonly)
Returns the value of attribute workflow_name.
4 5 6 |
# File 'lib/reactor/tools/workflow_generator.rb', line 4 def workflow_name @workflow_name end |
Instance Method Details
#destroy! ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/reactor/tools/workflow_generator.rb', line 27 def destroy! destroy_objs destroy_obj_class destroy_workflow destroy_users destroy_groups destroy_signatures end |
#generate! ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/reactor/tools/workflow_generator.rb', line 16 def generate! create_groups create_users create_signatures create_workflow create_obj_class create_obj start_workflow end |
#personal_group(user) ⇒ Object
36 37 38 |
# File 'lib/reactor/tools/workflow_generator.rb', line 36 def personal_group(user) "#{user}_group" end |