Sha256: e34b16607eb89b573acc93887a89f3fd90749cebeb9608ff0a28a92721aa0510

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

module TrackerApi
  module Resources
    class Epic
      include Shared::Base

      attribute :client

      attribute :comment_ids, Shared::Collection[Integer]
      attribute :comments, Shared::Collection[Comment]
      attribute :created_at, DateTime
      attribute :description, String
      attribute :follower_ids, Shared::Collection[Integer]
      attribute :followers, Shared::Collection[Person]
      attribute :kind, String
      attribute :label, Label
      attribute :label_id, Integer
      attribute :name, String
      attribute :project_id, Integer
      attribute :updated_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

2 entries across 2 versions & 1 rubygems

Version Path
tracker_api-1.1.0 lib/tracker_api/resources/epic.rb
tracker_api-1.0.0 lib/tracker_api/resources/epic.rb