Class: DearInventory::TestResponse
- Extended by:
- IsASubclass
- Defined in:
- lib/dear_inventory/test_response.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #http_status ⇒ Object
-
#initialize(request:, body:, num_previous_records: 0) ⇒ TestResponse
constructor
A new instance of TestResponse.
Methods included from IsASubclass
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
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/dear_inventory/test_response.rb', line 7 def request @request end |
#response ⇒ Object (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_status ⇒ Object
25 26 27 |
# File 'lib/dear_inventory/test_response.rb', line 25 def http_status 200 end |