Sha256: 2fe49862faf13920e3f1c0bd393db5aa8e49e1183d4075c191e74400f8677476
Contents?: true
Size: 898 Bytes
Versions: 4
Compression:
Stored size: 898 Bytes
Contents
# frozen_string_literal: true require 'goodwill/urlpaths' module Goodwill class BiddingAuction < Auction include URLPaths attr_reader :bidding, :winning, :max, :current, :end, :href, :item, :itemid, :seller, :shipping # TODO: why do i need this? attr_reader :bids def initialize(itemid, mechanize) super(itemid) order_page = mechanize.get(OPEN_ORDERS_URL) if order_page.link_with(text: regqt(itemid.to_s)) @bidding = true row = order_page.link_with(text: regqt(itemid.to_s)).node.parent.parent @winning = !row.search('td:nth-child(5) > i').empty? @max = row.search('td:nth-child(5)').text.tr("\r\n", '').tr(' ', '').tr('$', '') else @bidding = false @winning = false @max = '$0.00' end end private def regqt(itemid) /#{Regexp.quote(itemid.to_s)}/ end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
goodwill-0.4.6 | lib/goodwill/biddingauction.rb |
goodwill-0.4.4 | lib/goodwill/biddingauction.rb |
goodwill-0.4.3 | lib/goodwill/biddingauction.rb |
goodwill-0.4.1 | lib/goodwill/biddingauction.rb |