Sha256: 9d1e5cc285ad760ada7860d4670532fa236c9ae5e58bd74340922989dd8029cd

Contents?: true

Size: 746 Bytes

Versions: 17

Compression:

Stored size: 746 Bytes

Contents

module GeoCerts
  
  class MessageWithCode # :nodoc:
    attr_accessor :code, :message
    
    def initialize(attributes = {})
      self.code     = attributes[:code].to_i
      self.message  = attributes[:message]
    end
    
    def to_s #:nodoc:
      "#{self.class.name} ##{code}: #{message}"
    end
  end
  
  ##
  # Errors are returned when a request to GeoCerts fails.  The exception will be returned 
  # with a collection of Error objects which detail the error +code+ and +message+.
  # 
  class Error < MessageWithCode
  end
  
  ##
  # Warnings may be returned with either successful or unsuccessful requests to GeoCerts.  
  # Warnings contain the warning +code+ and +message+.
  # 
  class Warning < MessageWithCode
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
geocerts-1.0.1 lib/geo_certs/errors.rb
geocerts-1.0.0 lib/geo_certs/errors.rb
geocerts-0.0.25 lib/geo_certs/errors.rb
geocerts-0.0.24 lib/geo_certs/errors.rb
geocerts-0.0.23 lib/geo_certs/errors.rb
geocerts-0.0.22 lib/geo_certs/errors.rb
geocerts-0.0.21 lib/geo_certs/errors.rb
geocerts-0.0.20 lib/geo_certs/errors.rb
geocerts-0.0.19 lib/geo_certs/errors.rb
geocerts-0.0.18 lib/geo_certs/errors.rb
geocerts-0.0.17 lib/geo_certs/errors.rb
geocerts-0.0.16 lib/geo_certs/errors.rb
geocerts-0.0.15 lib/geo_certs/errors.rb
geocerts-0.0.14 lib/geo_certs/errors.rb
geocerts-0.0.13 lib/geo_certs/errors.rb
geocerts-0.0.12 lib/geo_certs/errors.rb
geocerts-0.0.11 lib/geo_certs/errors.rb