Class: Wf::CaseCommand::AddToken
- Inherits:
-
Object
- Object
- Wf::CaseCommand::AddToken
- Includes:
- SimpleCommand
- Defined in:
- app/models/wf/case_command/add_token.rb
Instance Attribute Summary collapse
-
#place ⇒ Object
readonly
Returns the value of attribute place.
-
#wf_case ⇒ Object
readonly
Returns the value of attribute wf_case.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(wf_case, place) ⇒ AddToken
constructor
A new instance of AddToken.
Constructor Details
#initialize(wf_case, place) ⇒ AddToken
Returns a new instance of AddToken.
7 8 9 10 |
# File 'app/models/wf/case_command/add_token.rb', line 7 def initialize(wf_case, place) @wf_case = wf_case @place = place end |
Instance Attribute Details
#place ⇒ Object (readonly)
Returns the value of attribute place.
6 7 8 |
# File 'app/models/wf/case_command/add_token.rb', line 6 def place @place end |
#wf_case ⇒ Object (readonly)
Returns the value of attribute wf_case.
6 7 8 |
# File 'app/models/wf/case_command/add_token.rb', line 6 def wf_case @wf_case end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/models/wf/case_command/add_token.rb', line 12 def call wf_case.tokens.create!( workflow: wf_case.workflow, place: place, state: :free ) end |