Class: Zendesk::Comment
- Includes:
- Constants
- Defined in:
- lib/zendesk/comment.rb
Constant Summary
Constants included from Constants
Zendesk::Constants::PRIORITY, Zendesk::Constants::RESTRICTION, Zendesk::Constants::ROLE, Zendesk::Constants::STATUS, Zendesk::Constants::TICKET_TYPE, Zendesk::Constants::VIA
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Comment
constructor
A new instance of Comment.
- #save ⇒ Object
- #to_xml ⇒ Object
Methods inherited from Resource
Methods included from Properties
Constructor Details
#initialize(attrs = {}) ⇒ Comment
Returns a new instance of Comment.
9 10 11 12 13 |
# File 'lib/zendesk/comment.rb', line 9 def initialize(attrs = {}) @ticket_id ||= attrs[:ticket_id] || attrs['ticket_id'] @is_public ||= false super end |
Instance Method Details
#save ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/zendesk/comment.rb', line 19 def save begin response = Zendesk.resource["tickets/#{ticket_id}.xml"].put self.to_xml, :content_type => 'application/xml' return (200..300).include?(response.headers[:status].to_i) rescue Exception => e puts e. return false end end |