Exception: Yandex::Direct::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/yandex/direct/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_id, code, text, detail) ⇒ Error

Returns a new instance of Error.



4
5
6
7
8
9
# File 'lib/yandex/direct/error.rb', line 4

def initialize(request_id, code, text, detail)
  self.request_id = request_id
  self.code = code
  self.text = text
  self.detail = detail
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



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

def code
  @code
end

#detailObject

Returns the value of attribute detail.



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

def detail
  @detail
end

#request_idObject

Returns the value of attribute request_id.



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

def request_id
  @request_id
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/yandex/direct/error.rb', line 10

def message
  "#{self.text} (#{self.code}): #{self.detail}"
end