Sha256: 7004f45ac306d1680b62d47bfc59e0b452d4998e7aa71d821f99411902348ea0

Contents?: true

Size: 747 Bytes

Versions: 20

Compression:

Stored size: 747 Bytes

Contents

module TrackerApi
  module Endpoints
    class Task
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def create(project_id, story_id, params={})
        data = client.post("/projects/#{project_id}/stories/#{story_id}/tasks", params: params).body
        Resources::Task.new({ client: client }.merge(data))
      end

      def update(task, params={})
        raise ArgumentError, 'Valid task required to update.' unless task.instance_of?(Resources::Task)

        data = client.put("/projects/#{task.project_id}/stories/#{task.story_id}/tasks/#{task.id}",
                          params: params).body

        task.attributes = data
        task.clean!
        task
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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