Sha256: eeaeda0547e793eaaa520c393f2b568c77b917d6771caf57d9ed3430e936c24c

Contents?: true

Size: 944 Bytes

Versions: 20

Compression:

Stored size: 944 Bytes

Contents

module TrackerApi
  module Resources
    class Task
      include Shared::Base

      attribute :client

      attribute :project_id, Integer
      attribute :story_id, Integer
      attribute :description, String
      attribute :complete, Boolean
      attribute :position, Integer
      attribute :created_at, DateTime
      attribute :updated_at, DateTime
      attribute :kind, String

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

        property :id
        property :description
        property :complete
        property :position
      end

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

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
tracker_api-1.16.0 lib/tracker_api/resources/task.rb
tracker_api-1.15.0 lib/tracker_api/resources/task.rb
tracker_api-1.14.0 lib/tracker_api/resources/task.rb
tracker_api-1.13.0 lib/tracker_api/resources/task.rb
tracker_api-1.12.0 lib/tracker_api/resources/task.rb
tracker_api-1.11.0 lib/tracker_api/resources/task.rb
tracker_api-1.10.0 lib/tracker_api/resources/task.rb
tracker_api-1.9.1 lib/tracker_api/resources/task.rb
tracker_api-1.9.0 lib/tracker_api/resources/task.rb
tracker_api-1.8.0 lib/tracker_api/resources/task.rb
tracker_api-1.7.1 lib/tracker_api/resources/task.rb
tracker_api-1.7.0 lib/tracker_api/resources/task.rb
tracker_api-1.6.0 lib/tracker_api/resources/task.rb
tracker_api-1.5.0 lib/tracker_api/resources/task.rb
tracker_api-1.4.1 lib/tracker_api/resources/task.rb
tracker_api-1.4.0 lib/tracker_api/resources/task.rb
tracker_api-1.3.0 lib/tracker_api/resources/task.rb
tracker_api-1.2.1 lib/tracker_api/resources/task.rb
tracker_api-1.1.1 lib/tracker_api/resources/task.rb
tracker_api-1.1.0 lib/tracker_api/resources/task.rb