Class: CombineHashtags::CLI
- Inherits:
-
Object
- Object
- CombineHashtags::CLI
- Defined in:
- lib/combine_hashtags/cli/cli.rb
Overview
methods for CLI implementation
Instance Method Summary collapse
-
#fetch_all ⇒ Object
sets new file_path/name for results of query's “next” pagination, update the profile, rinse repeat.
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
-
#start ⇒ Object
start cli.
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
10 11 12 13 14 15 16 17 |
# File 'lib/combine_hashtags/cli/cli.rb', line 10 def initialize @file_path = ENV["FILE_PATH"] @profile = CombineHashtags::Profile.new(@file_path) fetch_all @controller = CombineHashtags::Controller.new(@profile) @router = CombineHashtags::Router.new(@controller) end |
Instance Method Details
#fetch_all ⇒ Object
sets new file_path/name for results of query's “next” pagination, update the profile, rinse repeat
20 21 22 23 24 25 |
# File 'lib/combine_hashtags/cli/cli.rb', line 20 def fetch_all 10.times do |i| new_path = ENV["FILE_PATH"].gsub("00", "0#{i}") @profile.update(new_path) end end |
#start ⇒ Object
start cli
28 29 30 |
# File 'lib/combine_hashtags/cli/cli.rb', line 28 def start @router.run end |