Module: Recharge::HTTPRequest::Create

Includes:
Recharge::HTTPRequest
Included in:
Customer, Discount, Metafield, Subscription, Webhook
Defined in:
lib/recharge/http_request.rb

Overview

Create an new record for the included/extended entity

Arguments

data (Hash)

New record’s attributes

See the appropriate create call in ReCharge’s documentation for valid attributes

Returns

An instance of the created entity

Errors

Recharge::ConnectionError, Recharge::RequestError

Instance Method Summary collapse

Instance Method Details

#create(data) ⇒ Object



144
145
146
# File 'lib/recharge/http_request.rb', line 144

def create(data)
  new(POST(self::PATH, data)[self::SINGLE])
end