Exception: CdekApi::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = "", params = {}) ⇒ Error

Returns a new instance of Error.



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

def initialize(message = "", params = {})
  @title       = params[:title]
  @detail      = params[:detail]
  @body        = params[:body]
  @raw_body    = params[:raw_body]
  @status_code = params[:status_code]

  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#detailObject (readonly)

Returns the value of attribute detail.



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

def detail
  @detail
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



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

def raw_body
  @raw_body
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



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

def status_code
  @status_code
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/cdek_api/error.rb', line 15

def to_s
  super + " " + instance_variables_to_s
end