Class: ActiveResource::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/chargify_api_ares.rb

Direct Known Subclasses

Chargify::Base

Instance Method Summary collapse

Instance Method Details

#saveObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chargify_api_ares.rb', line 33

def save
  save_without_validation
  true
rescue ResourceInvalid => error
  case error.response['Content-Type']
  when /application\/xml/
    errors.from_xml(error.response.body)
  when /application\/json/
    errors.from_json(error.response.body)
  end
  false
end