Class: Japonica::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/japonica/cli.rb

Instance Method Summary collapse

Instance Method Details

#batch(file) ⇒ Object



21
22
23
24
25
26
# File 'lib/japonica/cli.rb', line 21

def batch(file)
  File.readlines(file).each do |l|
    url, max, type = l.split(' ')
    order(url, max, type)
  end
end

#order(url, max = 'xxxx', type = :instant) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/japonica/cli.rb', line 11

def order(url, max='xxxx', type=:instant)
  @auction = Japonica::Auction.load_url url
  @max_bid = max
  @bid_type = type_name type.to_sym
  
  # doesn't use thor's template() since i don't want to output to a file
  puts ERB.new(File.read(File.join(template_path, 'orderform.tt'))).result(binding)
end