Exception: YandexDelivery::YandexError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/yandex-delivery/yandex_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of YandexError.



5
6
7
8
9
10
11
12
13
# File 'lib/yandex-delivery/yandex_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/yandex-delivery/yandex_error.rb', line 3

def body
  @body
end

#detailObject (readonly)

Returns the value of attribute detail.



3
4
5
# File 'lib/yandex-delivery/yandex_error.rb', line 3

def detail
  @detail
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



3
4
5
# File 'lib/yandex-delivery/yandex_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/yandex-delivery/yandex_error.rb', line 3

def status_code
  @status_code
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/yandex-delivery/yandex_error.rb', line 3

def title
  @title
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/yandex-delivery/yandex_error.rb', line 15

def to_s
  super + " " + instance_variables_to_s
end