Class: ZendeskRails::Comment
- Defined in:
- app/models/zendesk_rails/comment.rb
Instance Attribute Summary collapse
-
#ticket ⇒ Object
readonly
Returns the value of attribute ticket.
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(ticket, attributes = {}) ⇒ Comment
constructor
A new instance of Comment.
- #save ⇒ Object
Methods inherited from Resource
has_fields, #method_missing, #persisted?, resource_not_found!, #respond_to_missing?
Constructor Details
#initialize(ticket, attributes = {}) ⇒ Comment
Returns a new instance of Comment.
8 9 10 11 |
# File 'app/models/zendesk_rails/comment.rb', line 8 def initialize(ticket, attributes = {}) @ticket = ticket super(attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ZendeskRails::Resource
Instance Attribute Details
#ticket ⇒ Object (readonly)
Returns the value of attribute ticket.
3 4 5 |
# File 'app/models/zendesk_rails/comment.rb', line 3 def ticket @ticket end |
Instance Method Details
#save ⇒ Object
13 14 15 16 17 |
# File 'app/models/zendesk_rails/comment.rb', line 13 def save return false unless valid? ticket.comment = { body: comment, author_id: requester_id } ticket.save end |