Class: Treehouse::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/treehouse-dl/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Returns a new instance of Runner.



8
9
10
# File 'lib/treehouse-dl/runner.rb', line 8

def initialize(argv)
  @opts = Options.new(argv)
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
# File 'lib/treehouse-dl/runner.rb', line 12

def run
  if !@opts.email.nil? and !@opts.password.nil? and !@opts.url.nil?
    Downloader.valid(@opts.url) if Downloader.(@opts.email,@opts.password)
  else
    puts "Account and url informations can't be blank".red
    exit
  end
end