Module: AppleStoreInventoryChecker

Defined in:
lib/apple_store_inventory_checker.rb,
lib/apple_store_inventory_checker/result.rb,
lib/apple_store_inventory_checker/version.rb,
lib/apple_store_inventory_checker/api_client.rb,
lib/apple_store_inventory_checker/api_request.rb,
lib/apple_store_inventory_checker/results_list.rb

Defined Under Namespace

Classes: APIClient, APIRequest, Error, Result, ResultsList

Constant Summary collapse

BASE_URL =
"https://www.apple.com/shop/retail/pickup-message".freeze
VERSION =
"0.1.1".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clientObject



22
23
24
# File 'lib/apple_store_inventory_checker.rb', line 22

def client
  @client ||= AppleStoreInventoryChecker::APIClient
end

Class Method Details

.base_urlObject



18
19
20
# File 'lib/apple_store_inventory_checker.rb', line 18

def base_url
  BASE_URL
end

.retrieve(product_id, zip:, max_distance: 15.0) ⇒ Object



26
27
28
29
# File 'lib/apple_store_inventory_checker.rb', line 26

def retrieve(product_id, zip:, max_distance: 15.0)
  instance = ResultsList.new(product_id, zip: zip, max_distance: max_distance)
  instance.refresh
end