Class: Rapa::Responses::SearchItemsResponse
Instance Method Summary
collapse
#each, #resources
#body, #headers, #initialize, #status
Instance Method Details
5
6
7
8
9
|
# File 'lib/rapa/responses/multiple_resources_response/search_items_response.rb', line 5
def error
if value = body.dig("ItemSearchResponse", "Items", "Request", "Errors", "Error")
::Rapa::Error.new(value)
end
end
|
#has_error? ⇒ Boolean
12
13
14
|
# File 'lib/rapa/responses/multiple_resources_response/search_items_response.rb', line 12
def has_error?
!error.nil?
end
|
#has_valid_request? ⇒ Boolean
17
18
19
|
# File 'lib/rapa/responses/multiple_resources_response/search_items_response.rb', line 17
def has_valid_request?
body.dig("ItemSearchResponse", "Items", "Request", "IsValid") == "True"
end
|
#total_pages ⇒ Integer?
22
23
24
25
26
|
# File 'lib/rapa/responses/multiple_resources_response/search_items_response.rb', line 22
def total_pages
if value = body.dig("ItemSearchResponse", "Items", "TotalPages")
value.to_i
end
end
|
#total_results ⇒ Integer?
29
30
31
32
33
|
# File 'lib/rapa/responses/multiple_resources_response/search_items_response.rb', line 29
def total_results
if value = body.dig("ItemSearchResponse", "Items", "TotalResults")
value.to_i
end
end
|