Sha256: b180f05609741189928657c8e8f230173cf11f601fb808a609eb965023c337f2

Contents?: true

Size: 999 Bytes

Versions: 3

Compression:

Stored size: 999 Bytes

Contents

module TrackerApi
  module Resources
    class Comment
      include Shared::Base

      attribute :client

      attribute :project_id, Integer
      attribute :story_id, Integer
      attribute :epic_id, Integer
      attribute :text, String
      attribute :person_id, Integer
      attribute :person, Person
      attribute :created_at, DateTime
      attribute :updated_at, DateTime
      attribute :file_attachment_ids, [Integer]
      attribute :google_attachment_ids, [Integer]
      attribute :commit_identifier, String
      attribute :commit_type, String
      attribute :kind, String

      class UpdateRepresenter < Representable::Decorator
        include Representable::JSON

        property :id
        property :text
      end

      def save
        raise ArgumentError, 'Cannot update a comment with an unknown story_id.' if story_id.nil?

        Endpoints::Comment.new(client).update(self, UpdateRepresenter.new(Comment.new(self.dirty_attributes)))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tracker_api-1.7.1 lib/tracker_api/resources/comment.rb
tracker_api-1.7.0 lib/tracker_api/resources/comment.rb
tracker_api-1.6.0 lib/tracker_api/resources/comment.rb