Class: TicketEvolution::ApiError

Inherits:
Model show all
Defined in:
lib/ticket_evolution/core/api_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#attributes, #attributes=, #endpoint, #plural_class, #plural_class_name, #scope

Methods inherited from Builder

#id, #id=, #to_hash

Methods included from SingularClass

#singular_class

Constructor Details

#initialize(response) ⇒ ApiError



6
7
8
9
10
11
# File 'lib/ticket_evolution/core/api_error.rb', line 6

def initialize(response)
  @status_code = response.response_code
  @message = response.server_message
  super(response.body)
  self.freeze
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TicketEvolution::Model

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/ticket_evolution/core/api_error.rb', line 3

def message
  @message
end

#status_codeObject (readonly) Also known as: code

Returns the value of attribute status_code.



3
4
5
# File 'lib/ticket_evolution/core/api_error.rb', line 3

def status_code
  @status_code
end