Exception: XingApi::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, name = '', text = '', errors = []) ⇒ Error

Returns a new instance of Error.



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

def initialize(status_code, name = '', text = '', errors = [])
  @status_code = status_code
  @name = name
  @text = text
  @errors = errors || []
  super(text)
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



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

def errors
  @errors
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



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

def status_code
  @status_code
end

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_sObject



13
14
15
# File 'lib/xing_api/error.rb', line 13

def to_s
  [status_code, name, text, errors.to_s].join(' - ')
end