Class: ActiveResource::Base

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

Direct Known Subclasses

Faturando::Base

Instance Method Summary collapse

Instance Method Details

#saveObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/faturando_api.rb', line 31

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