Class: Retab::JobResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/jobs/job_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  status_code: :status_code,
  body: :body
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ JobResponse

Returns a new instance of JobResponse.



17
18
19
20
21
# File 'lib/retab/jobs/job_response.rb', line 17

def initialize(json)
  hash = self.class.normalize(json)
  @status_code = hash[:status_code]
  @body = hash[:body] || {}
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



13
14
15
# File 'lib/retab/jobs/job_response.rb', line 13

def body
  @body
end

#status_codeObject

Returns the value of attribute status_code.



13
14
15
# File 'lib/retab/jobs/job_response.rb', line 13

def status_code
  @status_code
end