Sha256: 78c3a919bd77889dcd86e7d57fc1845a8e65b076be6d0efbcae8018faf30ea3e
Contents?: true
Size: 1.06 KB
Versions: 16
Compression:
Stored size: 1.06 KB
Contents
module Rapa module Responses class SearchItemsResponse < BaseResponse # @return [Rapa::Error] def error if value = body.dig("ItemSearchResponse", "Items", "Request", "Errors", "Error") ::Rapa::Error.new(value) end end # @return [Boolean] def has_error? !error.nil? end # @return [Boolean] def has_valid_request? body.dig("ItemSearchResponse", "Items", "Request", "IsValid") == "True" end # @return [Integer, nil] def total_pages if value = body.dig("ItemSearchResponse", "Items", "TotalPages") value.to_i end end # @return [Integer, nil] def total_results if value = body.dig("ItemSearchResponse", "Items", "TotalResults") value.to_i end end private # @note Override def resource_class ::Rapa::Resources::ItemResource end # @note Override def source_or_sources body.dig("ItemSearchResponse", "Items", "Item") end end end end
Version data entries
16 entries across 16 versions & 1 rubygems