Class: AutoBidder

Inherits:
Object
  • Object
show all
Defined in:
lib/auto_bidder.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, options) ⇒ AutoBidder

Returns a new instance of AutoBidder.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/auto_bidder.rb', line 10

def initialize(url, options)
  @num_bids = 0

  # Glean the TLD name from the host and use it to create the auction interface
  host = URI.parse(url).host
  begin
    @auction_interface = Module.const_get(host.split(".")[-2].capitalize).new(url, options)
  rescue NameError
    $log.fatal "Auction site #{host} not supported"
  end
end

Instance Method Details

#startObject



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

def start
  @auction_interface.connect_to_auction
  @auction_interface.start_monitoring
end