Sha256: 276d8f1888661bbd2deec3550759ca532678ead6eab9118a0ed5aca37dc1fd65

Contents?: true

Size: 967 Bytes

Versions: 1

Compression:

Stored size: 967 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 :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

1 entries across 1 versions & 1 rubygems

Version Path
tracker_api-1.5.0 lib/tracker_api/resources/comment.rb