Class: Trendious::Application
- Inherits:
-
Object
- Object
- Trendious::Application
- Defined in:
- lib/trendious/application.rb
Instance Method Summary collapse
-
#initialize ⇒ Application
constructor
A new instance of Application.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
5 6 7 8 |
# File 'lib/trendious/application.rb', line 5 def initialize @client = Trendious::Client.new = {} end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/trendious/application.rb', line 10 def run OptionParser.new do |opts| opts. = "Usage: trendious [options]" opts.on("-q", "--query [String]", String, "Search by name") {|o| [:query] = o } opts.on("-R", "--read [Integer]", Integer, "Read entry with index") {|o| [:read] = o } opts.on("-p", "--page [Integer]", Integer, "Select N page") {|o| [:page] = o } opts.on("-T", "--tags", "Show tags") {|o| [:tags] = o } opts.on("-t", "--trending [Integer]", Integer, "Select trending by index") {|o| [:trending] = o} opts.on("-v", "--version", "Display current Trendious version") {|o| [:version] = o } end.parse! puts output end |