class Goodwill::BiddingAuction

Attributes

bidding[R]
bids[R]

TODO: why do i need this?

current[R]
end[R]
href[R]
item[R]
itemid[R]
max[R]
seller[R]
shipping[R]
winning[R]

Public Class Methods

new(itemid, mechanize) click to toggle source
Calls superclass method Goodwill::Auction::new
# File lib/goodwill/biddingauction.rb, line 14
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 Instance Methods

regqt(itemid) click to toggle source
# File lib/goodwill/biddingauction.rb, line 31
def regqt(itemid)
  /#{Regexp.quote(itemid.to_s)}/
end