Sha256: ebe6e05f0a5013c0db8915cdfb9292b27e1a682d573f9c458c9d47b066724e74

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

module Campaigning
module Helpers #:nodoc:
  #Method responsable to handle all response from the API server and raising an exception when
  #the API returns an error code (different from 0 (zero) ).
  def handle_request(response)
    Helpers.handle_request response
  end
  
  #Method responsable to handle all response from the API server and raising an exception when
  #the API returns an error code (different from 0 (zero) ).
  def Helpers.handle_request(response)
    if (response.class == Campaigning::Result && response.code != 0)
       raise response.code.to_s + " - " + response.message
    end
    response
  end
  
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gnumarcelo-campaigning-0.8.2 lib/campaigning/helpers/helpers.rb