Class: PivotalAPI::Comment
- Defined in:
- lib/pivotal-tracker-api/comment.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#commit_identifier ⇒ Object
Returns the value of attribute commit_identifier.
-
#commit_type ⇒ Object
Returns the value of attribute commit_type.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#epic_id ⇒ Object
Returns the value of attribute epic_id.
-
#file_attachments ⇒ Object
Returns the value of attribute file_attachments.
-
#google_attachment_ids ⇒ Object
Returns the value of attribute google_attachment_ids.
-
#id ⇒ Object
Returns the value of attribute id.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#person ⇒ Object
Returns the value of attribute person.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#story_id ⇒ Object
Returns the value of attribute story_id.
-
#text ⇒ Object
Returns the value of attribute text.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from PivotalAPI::Base
Instance Attribute Details
#commit_identifier ⇒ Object
Returns the value of attribute commit_identifier.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def commit_identifier @commit_identifier end |
#commit_type ⇒ Object
Returns the value of attribute commit_type.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def commit_type @commit_type end |
#created_at ⇒ Object
Returns the value of attribute created_at.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def created_at @created_at end |
#epic_id ⇒ Object
Returns the value of attribute epic_id.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def epic_id @epic_id end |
#file_attachments ⇒ Object
Returns the value of attribute file_attachments.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def @file_attachments end |
#google_attachment_ids ⇒ Object
Returns the value of attribute google_attachment_ids.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def @google_attachment_ids end |
#id ⇒ Object
Returns the value of attribute id.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def id @id end |
#kind ⇒ Object
Returns the value of attribute kind.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def kind @kind end |
#person ⇒ Object
Returns the value of attribute person.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def person @person end |
#project_id ⇒ Object
Returns the value of attribute project_id.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def project_id @project_id end |
#story_id ⇒ Object
Returns the value of attribute story_id.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def story_id @story_id end |
#text ⇒ Object
Returns the value of attribute text.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def text @text end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
41 42 43 |
# File 'lib/pivotal-tracker-api/comment.rb', line 41 def updated_at @updated_at end |
Class Method Details
.fields ⇒ Object
46 47 48 49 50 |
# File 'lib/pivotal-tracker-api/comment.rb', line 46 def self.fields ["person(#{Person.fields.join(',')})", 'text', 'updated_at', 'id', 'created_at', 'story_id', 'file_attachments', 'google_attachment_ids', 'commit_identifier', 'commit_type', 'kind'] end |
.from_json(json) ⇒ Object
52 53 54 |
# File 'lib/pivotal-tracker-api/comment.rb', line 52 def self.from_json(json) parse_json_comment(json) end |
.parse_json_comment(comment) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/pivotal-tracker-api/comment.rb', line 56 def self.parse_json_comment(comment) person = Person.from_json(comment[:person]) if comment[:person] person = Person.unkown if person.nil? new({ id: comment[:id].to_i, text: comment[:text], person: person, created_at: DateTime.parse(comment[:created_at].to_s), updated_at: DateTime.parse(comment[:updated_at].to_s), file_attachments: FileAttachments.from_json(comment[:file_attachments]), commit_identifier: comment[:commit_identifier], google_attachment_ids: comment[:google_attachment_ids], commit_type: comment[:commit_type], kind: comment[:kind] }) end |