Sha256: 76bcf7561a71a897e825c714c6706edd86a3296de0c6245b187cbdca30b9d9e8
Contents?: true
Size: 937 Bytes
Versions: 1
Compression:
Stored size: 937 Bytes
Contents
# frozen_string_literal: true require 'thor' module Goodwill class CLI < Thor class_option :verbose, type: :boolean class_option :username class_option :password 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 } @account = Goodwill::Account.new(username, password) end desc 'auctions', "List all auctions you're currently bidding on" def auctions say "Your current auctions:\n" tp @account.in_progress end desc 'search SEARCH', 'Search for auctions matching SEARCH' def search(search) say 'Your search results:' tp @account.search(search) end desc 'bid ITEMID MAXBID', 'Bid MAXBID on ITEMID' def bid(itemid, maxbid) @accounts.bid(itemid, maxbid) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
goodwill-0.4.0 | lib/goodwill/cli.rb |