Class: Tabulator::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/tabulator/reader.rb

Defined Under Namespace

Classes: Worksheet

Instance Method Summary collapse

Constructor Details

#initialize(file_key, config_file = 'config.json') ⇒ Reader

Returns a new instance of Reader.



8
9
10
11
# File 'lib/tabulator/reader.rb', line 8

def initialize file_key, config_file = 'config.json'
  session = GoogleDrive::Session.(config_file)
  @file = session.spreadsheet_by_key(file_key)
end

Instance Method Details

#[](worksheet) ⇒ Object



13
14
15
# File 'lib/tabulator/reader.rb', line 13

def [] worksheet
  Worksheet.build @file.worksheets[worksheet].rows
end