class WeddingRegistryScraper::Registries::PotteryBarn

Private Instance Methods

get_desired(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 32
def get_desired(product)
  product.css('.requested').text.strip.to_i
end
get_image_url(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 23
def get_image_url(product)
  thumb_src = product.css('.product-image img')[0]['src']
  thumb_src.sub(/f\.jpg$/, 'c.jpg')
end
get_name(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 9
def get_name(product)
  product.css('.product-name').text.strip
end
get_price(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 36
def get_price(product)
  product.css('.product-price .price-amount').text.to_f
end
get_products(doc) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 5
def get_products(doc)
  doc.css('.regListItem')
end
get_remaining(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 28
def get_remaining(product)
  product.css('.still-needs').text.strip.to_i
end
get_sku(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 13
def get_sku(product)
  sku = product.css('.product-sku').text.strip
  "potterybarn:#{sku}"
end
get_url(product) click to toggle source
# File lib/wedding_registry_scraper/registries/pottery_barn.rb, line 18
def get_url(product)
  # TODO pop up modal? set proper anchor (they're not unique!)
  @url
end