Class: PlatformAPI::Credit

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

A credit represents value that will be used up before further charges are assigned to an account.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Credit

Returns a new instance of Credit.



1654
1655
1656
# File 'lib/platform-api/client.rb', line 1654

def initialize(client)
  @client = client
end

Instance Method Details

#create(body = {}) ⇒ Object

Create a new credit.

Parameters:

  • body:

    the object to pass as the request payload



1661
1662
1663
# File 'lib/platform-api/client.rb', line 1661

def create(body = {})
  @client.credit.create(body)
end

#info(credit_id) ⇒ Object

Info for existing credit.

Parameters:

  • credit_id:

    unique identifier of credit



1668
1669
1670
# File 'lib/platform-api/client.rb', line 1668

def info(credit_id)
  @client.credit.info(credit_id)
end

#listObject

List existing credits.



1673
1674
1675
# File 'lib/platform-api/client.rb', line 1673

def list()
  @client.credit.list()
end