Class: DearInventory::TestResponse

Inherits:
Response
  • Object
show all
Extended by:
IsASubclass
Defined in:
lib/dear_inventory/test_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from IsASubclass

is_a?

Methods inherited from Response

#each, #error, #fields, #headers, #next_page, #next_page?, #num_records_paged, #paginated?, #raise_not_paginated, #success?, #uri

Constructor Details

#initialize(request:, body:, num_previous_records: 0) ⇒ TestResponse

Returns a new instance of TestResponse.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dear_inventory/test_response.rb', line 9

def initialize(request:, body:, num_previous_records: 0)
  @request = request
  @num_previous_records = num_previous_records

  @fields = nil
  @http_status = nil
  @load_full_record = nil
  @num_records_paged = nil
  @uri = nil

  raise_error unless success?

  @model = @request.model.new(body)
  assign_values
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



7
8
9
# File 'lib/dear_inventory/test_response.rb', line 7

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/dear_inventory/test_response.rb', line 7

def response
  @response
end

Instance Method Details

#http_statusObject



25
26
27
# File 'lib/dear_inventory/test_response.rb', line 25

def http_status
  200
end