Class: Dropdown::Readers::DropboxReader

Inherits:
Object
  • Object
show all
Defined in:
lib/dropdown/readers/dropbox_reader.rb

Instance Method Summary collapse

Instance Method Details

#find_html_files(path) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dropdown/readers/dropbox_reader.rb', line 11

def find_html_files(path)
  files = []
  contents = client.(path)['contents']
  contents.each do |child|
    unless child['is_dir']
      path = child['path']
      if Dropdown::HTML_EXTENSIONS.include? File.extname(path)
        files << path
      end
    end
  end
  files
end

#read(path) ⇒ Object



7
8
9
# File 'lib/dropdown/readers/dropbox_reader.rb', line 7

def read(path)
  client.get_file(path)
end