Class: BeautydateApi::BusinessPayment

Inherits:
APIResource show all
Defined in:
lib/beautydate_api/business_payment.rb

Instance Attribute Summary

Attributes inherited from Object

#errors, #id

Instance Method Summary collapse

Methods inherited from APIResource

endpoint_url, #is_new?, object_base_uri, relative_url, url

Methods inherited from Object

#add_accessor, #attributes, #initialize, #set_attributes, #unsaved_attributes, #unsaved_data

Constructor Details

This class inherits a constructor from BeautydateApi::Object

Instance Method Details

#create(attributes) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/beautydate_api/business_payment.rb', line 3

def create(attributes)
  result = APIRequest.request('POST', self.class.endpoint_url, create_params(attributes))
  self.errors = nil
  update_attributes_from_result result
  true
rescue BeautydateApi::RequestWithErrors => e
  self.errors = e.errors
  false
end