Sha256: 3ce555033636172af883496e9862a7ed90a053987783587f55cd46779de66c6e

Contents?: true

Size: 864 Bytes

Versions: 6

Compression:

Stored size: 864 Bytes

Contents

module Telesignature
  class TelesignError < ::StandardError
    # """
    # The **exceptions** base class.

    # .. list-table::
    #    :widths: 5 30
    #    :header-rows: 1

    #    * - Attributes
    #      -
    #    * - `data`
    #      - The data returned by the service, in a dictionary form.
    #    * - `http_response`
    #      - The full HTTP Response object, including the HTTP status code, headers, and raw returned data.

    # """

    attr_accessor :errors, :headers, :status, :data, :raw_data

    def initialize errors, http_response
      @errors = errors
      @headers = http_response[:headers]
      @status = http_response[:status_code]
      @data = http_response[:text]
      @raw_data = http_response[:text]
      super()
    end

    def to_s
      @errors.inject(''){|ret, x| ret += "%s\n" % x[:description] }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
telesignature-0.0.7 lib/telesignature/telesign_error.rb
telesignature-0.0.6 lib/telesignature/telesign_error.rb
telesignature-0.0.5 lib/telesignature/telesign_error.rb
telesignature-0.0.4 lib/telesignature/telesign_error.rb
telesignature-0.0.3 lib/telesignature/telesign_error.rb
telesignature-0.0.2 lib/telesignature/telesign_error.rb