Sha256: 373c7be04c0f46864c19c86afdf7f3c22ee743103afc64044897af96324673f2

Contents?: true

Size: 752 Bytes

Versions: 12

Compression:

Stored size: 752 Bytes

Contents

module TrackerApi
  module Endpoints
    class Project
      attr_accessor :client

      def initialize(client)
        @client = client
      end

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

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

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

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

      def update(id, params={})
        data = client.put("/projects/#{id}", params: params).body

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

      def delete(id)
        client.delete("/projects/#{id}").body
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
v2gpti-1.3.5 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.3.4 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.3.3 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.3.2 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.3.1 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.3.0 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.2.9 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.2.8 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.2.7 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.2.6 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.2.5 tracker_api/lib/tracker_api/endpoints/project.rb
v2gpti-1.2.4 tracker_api/lib/tracker_api/endpoints/project.rb