Class: LigaMagicScraper::CLI
- Inherits:
-
Object
- Object
- LigaMagicScraper::CLI
- Defined in:
- lib/ligamagic_scraper/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #create_scraper ⇒ Object
-
#initialize(argv = ARGV) ⇒ CLI
constructor
A new instance of CLI.
- #parse ⇒ Object
Constructor Details
#initialize(argv = ARGV) ⇒ CLI
Returns a new instance of CLI.
7 8 9 10 |
# File 'lib/ligamagic_scraper/cli.rb', line 7 def initialize(argv = ARGV) @argv = argv = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/ligamagic_scraper/cli.rb', line 5 def end |
Instance Method Details
#create_scraper ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ligamagic_scraper/cli.rb', line 18 def create_scraper alert_config = build_alert_config if store_search? StoreScraper.new( store_domain: [:store_domain], search_term: [:search], max_pages: [:max_pages], browser_mode: [:browser_mode], alert_config: alert_config ) else GlobalScraper.new( search_term: [:search], browser_mode: [:browser_mode], alert_config: alert_config ) end end |
#parse ⇒ Object
12 13 14 15 16 |
# File 'lib/ligamagic_scraper/cli.rb', line 12 def parse option_parser.parse!(@argv) self end |