class Goodwill::CLI
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/goodwill/cli.rb, line 12 def initialize(*args) super return if args[2][:current_command].name == 'help' username = options[:username] || ask('Username:') password = options[:password] || ask('Password:') { |q| q.echo = false } threads = options[:threads].to_i || 10 @account = Goodwill::Account.new(username, password, threads) end
Public Instance Methods
auctions()
click to toggle source
# File lib/goodwill/cli.rb, line 23 def auctions say "Your current auctions:\n" res = @account.in_progress if res.empty? puts 'No items found.' else tp res end end
bid(itemid, maxbid)
click to toggle source
# File lib/goodwill/cli.rb, line 45 def bid(itemid, maxbid) @accounts.bid(itemid, maxbid) end
search(search)
click to toggle source
# File lib/goodwill/cli.rb, line 34 def search(search) say 'Your search results:' res = @account.search(search) if res.empty? puts 'No items found.' else tp res end end