module Mambu::Helpers

Public Instance Methods

camelize_hash(options) click to toggle source
# File lib/mambu/helpers.rb, line 14
def camelize_hash(options)
  Hash[options.map { |k, v| [k.to_s.camelize(:lower).to_sym, v] }]
end
handle_error(response) click to toggle source
# File lib/mambu/helpers.rb, line 3
def handle_error(response)
  return if response.success?
  error = response.error
  if error.status == 'INTERNAL_SERVER_ERROR'
    error = Mambu::Error.new(
      'Mambu API returned error without message.'
    )
  end
  fail error
end