Sha256: 0ed7fee769e47eba250737c522c79e487cc34b1af881e032edef72447fc67bf9

Contents?: true

Size: 378 Bytes

Versions: 1

Compression:

Stored size: 378 Bytes

Contents

module Ebay::Finding::Api
  class Response
    attr_reader :response

    def initialize(key_name, response)
      @key_name = key_name
      @response = response
    end

    def items
      return [] unless success?

      @items ||= JSON.parse(@response.body)["#{@key_name}Response"].first["searchResult"]
    end

    def success?
      @response.success?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ebay-finding-api-0.1.0 lib/ebay/finding/api/response.rb