Class: Wf::CaseCommand::New
- Inherits:
-
Object
- Object
- Wf::CaseCommand::New
- Includes:
- SimpleCommand
- Defined in:
- app/models/wf/case_command/new.rb
Instance Attribute Summary collapse
-
#started_by ⇒ Object
readonly
Returns the value of attribute started_by.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(workflow, target = nil, started_by = nil) ⇒ New
constructor
A new instance of New.
Constructor Details
#initialize(workflow, target = nil, started_by = nil) ⇒ New
Returns a new instance of New.
7 8 9 10 11 |
# File 'app/models/wf/case_command/new.rb', line 7 def initialize(workflow, target = nil, started_by = nil) @workflow = workflow @target = target @started_by = started_by end |
Instance Attribute Details
#started_by ⇒ Object (readonly)
Returns the value of attribute started_by.
6 7 8 |
# File 'app/models/wf/case_command/new.rb', line 6 def started_by @started_by end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
6 7 8 |
# File 'app/models/wf/case_command/new.rb', line 6 def target @target end |
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
6 7 8 |
# File 'app/models/wf/case_command/new.rb', line 6 def workflow @workflow end |
Instance Method Details
#call ⇒ Object
13 14 15 16 |
# File 'app/models/wf/case_command/new.rb', line 13 def call wf_case = workflow.cases.create!(targetable: target, started_by_workitem: started_by, state: :created) wf_case end |