Sha256: 526634d087df4c8520d8fa59f42a1e73388107195e90c9f2903d478f4ff8596b

Contents?: true

Size: 762 Bytes

Versions: 6

Compression:

Stored size: 762 Bytes

Contents

module Nurego
  class Customer < APIResource
    include Nurego::APIOperations::List

    def self.me(api_key = nil)
      response, api_key = Nurego.request(:get, me_url, api_key)
      Util.convert_to_nurego_object(response, api_key)
    end

    def organizations
      Organization.all({:customer => id }, @api_key)
    end

    def self.me_url
      '/v1/customers/me'
    end

    def self.update_plan(plan_guid)
      response, api_key = Nurego.request(:put, "/v1/customers/plan", nil, { :plan_id => plan_guid })
      Util.convert_to_nurego_object(response, api_key)
    end

    def self.cancel_account
      response, api_key = Nurego.request(:put, "/v1/customers/cancel", nil)
      Util.convert_to_nurego_object(response, api_key)
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nurego-1.0.8 lib/nurego/customer.rb
nurego-1.0.7 lib/nurego/customer.rb
nurego-1.0.6 lib/nurego/customer.rb
nurego-1.0.5 lib/nurego/customer.rb
nurego-1.0.4 lib/nurego/customer.rb
nurego-1.0.1 lib/nurego/customer.rb