Exception: OpenCNAM::OpenCNAMError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/opencnam/errors/opencnam_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ OpenCNAMError

Returns a new instance of OpenCNAMError.



7
8
9
10
11
# File 'lib/opencnam/errors/opencnam_error.rb', line 7

def initialize(opts = {})
  @message = opts[:message] || nil
  @http_status = opts[:http_status] || nil
  @http_body = opts[:http_body] || nil
end

Instance Attribute Details

#http_bodyObject (readonly)

Returns the value of attribute http_body.



5
6
7
# File 'lib/opencnam/errors/opencnam_error.rb', line 5

def http_body
  @http_body
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



4
5
6
# File 'lib/opencnam/errors/opencnam_error.rb', line 4

def http_status
  @http_status
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/opencnam/errors/opencnam_error.rb', line 3

def message
  @message
end

Instance Method Details

#to_sObject



13
14
15
16
# File 'lib/opencnam/errors/opencnam_error.rb', line 13

def to_s
  status = @http_status.nil? ? "" : "(Status #{@http_status}) "
  "#{status}#{@message}"
end