Sha256: 8e570255901ff700ac296694ec2eb49351d89dc793504226ada9bab7340a4e92

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

module TrackerApi
  module Endpoints
    class Story
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def get(project_id, id)
        data = client.get("/projects/#{project_id}/stories/#{id}").body

        Resources::Story.new({ client: client, project_id: project_id }.merge(data))
      end

      def get_story(story_id)
        data = client.get("/stories/#{story_id}").body

        Resources::Story.new({ client: client }.merge(data))
      end

      def create(project_id, params={})
        data = client.post("/projects/#{project_id}/stories", params: params).body

        Resources::Story.new({ client: client }.merge(data))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tracker_api-0.2.6 lib/tracker_api/endpoints/story.rb