Class: WhosDatedWho::CLI
- Inherits:
-
Thor
- Object
- Thor
- WhosDatedWho::CLI
- Defined in:
- lib/whos_dated_who/cli.rb
Instance Method Summary collapse
- #explore ⇒ Object
- #import_maxim ⇒ Object
- #import_mine ⇒ Object
- #query(name) ⇒ Object
- #version ⇒ Object
Instance Method Details
#explore ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/whos_dated_who/cli.rb', line 19 def explore results = [] celebs = my_celebs celebs.each do |celeb| puts "Processing #{celeb}..." begin results << Client.new.fetch(celeb) rescue puts "Error processing #{celeb}" end end results end |
#import_maxim ⇒ Object
39 40 41 |
# File 'lib/whos_dated_who/cli.rb', line 39 def import_maxim resp = Faraday.get('http://www.maxim.com/hot100/2014') end |
#import_mine ⇒ Object
34 35 36 |
# File 'lib/whos_dated_who/cli.rb', line 34 def import_mine Importer.new('celebs', 'mine').fetch_and_import(my_celebs) end |
#query(name) ⇒ Object
12 13 14 15 16 |
# File 'lib/whos_dated_who/cli.rb', line 12 def query(name) result = Client.new.fetch(name) puts "#{result[:relationship_status]}: #{result[:current_relationship][:human]}" puts result[:current_relationship][:dates].join(", ") end |
#version ⇒ Object
7 8 9 |
# File 'lib/whos_dated_who/cli.rb', line 7 def version puts WhosDatedWho::VERSION end |