Class: DropSync::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/dropsync/engine.rb

Instance Method Summary collapse

Constructor Details

#initialize(access_token) ⇒ Engine

Returns a new instance of Engine.



3
4
5
# File 'lib/dropsync/engine.rb', line 3

def initialize(access_token)
  @client = DropboxApi::Client.new(access_token)
end

Instance Method Details

#download(path) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/dropsync/engine.rb', line 7

def download(path)
  puts '--- DropSync ---'
  puts "> Searching for #{path}"
  url = get_url(path)
  puts '> Downloading file'
  Auto.download(path, url)
  puts '> Download finished'
  logout
end