Class: Wf::CaseCommand::Suspend
- Inherits:
-
Object
- Object
- Wf::CaseCommand::Suspend
- Includes:
- SimpleCommand
- Defined in:
- app/models/wf/case_command/suspend.rb
Instance Attribute Summary collapse
-
#wf_case ⇒ Object
readonly
Returns the value of attribute wf_case.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(wf_case) ⇒ Suspend
constructor
A new instance of Suspend.
Constructor Details
#initialize(wf_case) ⇒ Suspend
Returns a new instance of Suspend.
7 8 9 |
# File 'app/models/wf/case_command/suspend.rb', line 7 def initialize(wf_case) @wf_case = wf_case end |
Instance Attribute Details
#wf_case ⇒ Object (readonly)
Returns the value of attribute wf_case.
6 7 8 |
# File 'app/models/wf/case_command/suspend.rb', line 6 def wf_case @wf_case end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 |
# File 'app/models/wf/case_command/suspend.rb', line 11 def call raise("Only active or suspended cases can be canceled") unless wf_case.active? wf_case.suspended! end |