Exception: XingApi::Error
- Inherits:
-
StandardError
- Object
- StandardError
- XingApi::Error
- Defined in:
- lib/xing_api/error.rb
Direct Known Subclasses
AccessDeniedError, InvalidOauthTokenError, InvalidParameterError, OauthError, RateLimitExceededError, ServerError
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(status_code, name = '', text = '', errors = []) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
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
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/xing_api/error.rb', line 3 def errors @errors end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/xing_api/error.rb', line 3 def name @name end |
#status_code ⇒ Object (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 |
#text ⇒ Object (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_s ⇒ Object
13 14 15 |
# File 'lib/xing_api/error.rb', line 13 def to_s [status_code, name, text, errors.to_s].join(' - ') end |