Sha256: d605477954c1c7a0096fa5227174e56ad74bbecf81a7bbce911fbdc184a00b3c

Contents?: true

Size: 929 Bytes

Versions: 1

Compression:

Stored size: 929 Bytes

Contents

module Heroku
  class API

    # DELETE /apps/:app/addons/:addon
    def delete_addon(app, addon)
      request(
        :expects  => 200,
        :method   => :delete,
        :path     => "/apps/#{app}/addons/#{addon}"
      )
    end

    # GET /addons
    # GET /apps/:app/addons
    def get_addons(app=nil)
      path = if app
        "/apps/#{app}/addons"
      else
        "/addons"
      end
      request(
        :expects  => 200,
        :method   => :get,
        :path     => path
      )
    end

    # POST /apps/:app/addons/:addon
    def post_addon(app, addon)
      request(
        :expects  => 200,
        :method   => :post,
        :path     => "/apps/#{app}/addons/#{addon}"
      )
    end

    # PUT /apps/:app/addons/:addon
    def put_addon(app, addon)
      request(
        :expects  => 200,
        :method   => :put,
        :path     => "/apps/#{app}/addons/#{addon}"
      )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heroku-api-0.1.0 lib/heroku/api/addons.rb