Class: Wf::CaseCommand::AddComment
- Inherits:
-
Object
- Object
- Wf::CaseCommand::AddComment
- Includes:
- SimpleCommand
- Defined in:
- app/models/wf/case_command/add_comment.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#workitem ⇒ Object
readonly
Returns the value of attribute workitem.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(workitem, comment, user) ⇒ AddComment
constructor
A new instance of AddComment.
Constructor Details
#initialize(workitem, comment, user) ⇒ AddComment
Returns a new instance of AddComment.
7 8 9 10 11 |
# File 'app/models/wf/case_command/add_comment.rb', line 7 def initialize(workitem, comment, user) @workitem = workitem @comment = comment @user = user end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
6 7 8 |
# File 'app/models/wf/case_command/add_comment.rb', line 6 def comment @comment end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'app/models/wf/case_command/add_comment.rb', line 6 def user @user end |
#workitem ⇒ Object (readonly)
Returns the value of attribute workitem.
6 7 8 |
# File 'app/models/wf/case_command/add_comment.rb', line 6 def workitem @workitem end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'app/models/wf/case_command/add_comment.rb', line 13 def call workitem.comments.create!(user: user, body: comment) end |