Class: DeviantArt::Error

Inherits:
Base
  • Object
show all
Defined in:
lib/deviantart/error.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

point_to_class, points_class_mapping

Constructor Details

#initialize(json, status_code) ⇒ Error

Returns a new instance of Error.



30
31
32
33
# File 'lib/deviantart/error.rb', line 30

def initialize(json, status_code)
  super(json)
  @status_code = status_code
end

Instance Attribute Details

#errorObject

:method: status_code This is the HTTP status code of response.



28
29
30
# File 'lib/deviantart/error.rb', line 28

def error
  @error
end

#error_codeObject

:method: status_code This is the HTTP status code of response.



28
29
30
# File 'lib/deviantart/error.rb', line 28

def error_code
  @error_code
end

#error_descriptionObject

:method: status_code This is the HTTP status code of response.



28
29
30
# File 'lib/deviantart/error.rb', line 28

def error_description
  @error_description
end

#error_detailsObject

:method: status_code This is the HTTP status code of response.



28
29
30
# File 'lib/deviantart/error.rb', line 28

def error_details
  @error_details
end

#status_codeObject

:method: status_code This is the HTTP status code of response.



28
29
30
# File 'lib/deviantart/error.rb', line 28

def status_code
  @status_code
end

Instance Method Details

#to_sObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/deviantart/error.rb', line 35

def to_s
  messages = []
  messages << self.class.name
  messages << "status_code: #{@status_code}"
  messages << "error_code: #{@error_code}" if @error_code
  messages << "error: #{@error}" if @error
  messages << "error_description: #{@error_description}" if @error_description
  messages << "error_details: #{@error_details}" if @error_details
  messages.join(', ')
end