Exception: Mobitex::ConnectionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mobitex/connection_errors.rb

Direct Known Subclasses

ClientError, Redirection, ServerError, TimeoutError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, message = nil) ⇒ ConnectionError

Returns a new instance of ConnectionError.



6
7
8
9
# File 'lib/mobitex/connection_errors.rb', line 6

def initialize(response, message = nil)
  @response = response
  @message  = message
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/mobitex/connection_errors.rb', line 4

def response
  @response
end

Instance Method Details

#to_sObject



11
12
13
14
15
16
# File 'lib/mobitex/connection_errors.rb', line 11

def to_s
  message = "Connection Failed."
  message << "  Response Code = #{response.code}." if response.respond_to?(:code)
  message << "  Response Message = #{response.message}." if response.respond_to?(:message)
  message
end