class Oracle::Tool
Public Instance Methods
run( args )
click to toggle source
# File lib/cryptoquotes.rb, line 102 def run( args ) opts = { n: 1 } parser = OptionParser.new do |cmd| cmd.banner = "Usage: oracle [options]" cmd.separator " Print wise oracle sayings / crypto quotes" cmd.separator "" cmd.separator " Options:" cmd.on("-n", "--number=NUM", "Number of quotes to print (default: #{opts[:n]})", Integer ) do |num| opts[:n] = num end cmd.on("-h", "--help", "Prints this help") do puts cmd exit end end parser.parse!( args ) ## pp opts n = opts[:n] n.times { Oracle.say } end