Sha256: 8f0957a598895d0b4c12755ff5d7f8df90f265cc02432ee5b15b99689a057c52

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

module TrackerApi
  module Resources
    class Epic
      include Shared::Base

      attribute :client

      attribute :comment_ids, [Integer]
      attribute :comments, [Comment]
      attribute :created_at, DateTime
      attribute :description, String
      attribute :follower_ids, [Integer]
      attribute :followers, [Person]
      attribute :kind, String
      attribute :label, Label
      attribute :label_id, Integer
      attribute :name, String
      attribute :project_id, Integer
      attribute :updated_at, DateTime
      attribute :completed_at, DateTime
      attribute :url, String

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

        property :name
        property :description
        property :label, class: Label, decorator: Label::UpdateRepresenter, render_empty: true
      end

      # Save changes to an existing Epic.
      def save
        raise ArgumentError, 'Can not update an epic with an unknown project_id.' if project_id.nil?

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tracker_api-1.7.1 lib/tracker_api/resources/epic.rb
tracker_api-1.7.0 lib/tracker_api/resources/epic.rb
tracker_api-1.6.0 lib/tracker_api/resources/epic.rb
tracker_api-1.5.0 lib/tracker_api/resources/epic.rb
tracker_api-1.4.1 lib/tracker_api/resources/epic.rb
tracker_api-1.4.0 lib/tracker_api/resources/epic.rb
tracker_api-1.3.0 lib/tracker_api/resources/epic.rb