Exception: Xhash::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/xhash/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Error

Returns a new instance of Error.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/xhash/error.rb', line 5

def initialize(options = {})
  if options.is_a? Hash
    @message = options[:message]
    @response = options[:response]
  else
    @message = "Server error"
    @response = options
  end

  super
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/xhash/error.rb', line 3

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/xhash/error.rb', line 3

def response
  @response
end