Sha256: ec0afd554328dc74dca2d0327d5fea22509c66f0b97fee53d96b5f70f3d558f5
Contents?: true
Size: 637 Bytes
Versions: 10
Compression:
Stored size: 637 Bytes
Contents
module GunBroker # Represents a page of GunBroker items (listings). class ItemsAsPage # @param attrs [Hash] The attributes required to fetch items from the API. def initialize(attributes = {}) @attributes = attributes end # @return [Array<Item>] def fetch_items @attributes[:params].merge!({ 'PageIndex' => @attributes[:page_index], 'PageSize' => @attributes[:page_size], }) response = GunBroker::API.get(@attributes[:endpoint], @attributes[:params], @attributes[:token_header]) response['results'].map { |result| GunBroker::Item.new(result) } end end end
Version data entries
10 entries across 10 versions & 1 rubygems