Class: HurriyetCli::HammerOfTheGods
- Inherits:
-
Thor
- Object
- Thor
- HurriyetCli::HammerOfTheGods
- Defined in:
- lib/hurriyet_cli/cli.rb
Instance Method Summary collapse
Instance Method Details
#articles ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/hurriyet_cli/cli.rb', line 13 def articles client = Hurriyet::Client.new(ENV['API_KEY']) articles = HurriyetCli::Articles.new(client) if [:top] puts "Fetching #{[:top]} articles" articles.top_articles([:top]) else puts "Fetching all articles" articles.fetch end end |
#columns ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/hurriyet_cli/cli.rb', line 27 def columns client = Hurriyet::Client.new(ENV['API_KEY']) columns = HurriyetCli::Columns.new(client) if [:top] puts "Fetching #{[:top]} columns" columns.top_columns([:top]) else puts "Fetching all columns" columns.fetch end end |
#pages ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/hurriyet_cli/cli.rb', line 41 def pages client = Hurriyet::Client.new(ENV['API_KEY']) pages = HurriyetCli::Pages.new(client) if [:top] puts "Fetching #{[:top]} pages" pages.top_pages([:top]) else puts "Fetching all pages" pages.fetch end end |
#writers ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/hurriyet_cli/cli.rb', line 55 def writers client = Hurriyet::Client.new(ENV['API_KEY']) writers = HurriyetCli::Writers.new(client) if [:top] puts "Fetching #{[:top]} writers" writers.top_writers([:top]) else puts "Fetching all writers" writers.fetch end end |