Module: Gaf::Worksheet::LoadWorksheet

Defined in:
lib/gaf/worksheet/load_worksheet.rb

Instance Method Summary collapse

Instance Method Details

#get_first_rowObject



11
12
13
14
15
16
# File 'lib/gaf/worksheet/load_worksheet.rb', line 11

def get_first_row
  @hash_row_title = {}
  @worksheet.rows.first.each_with_index do |value, index|
    @hash_row_title.store(value, index + 1)
  end
end

#load_worksheetObject



4
5
6
7
8
9
# File 'lib/gaf/worksheet/load_worksheet.rb', line 4

def load_worksheet
  session = GoogleDrive::Session.from_config(Gaf.config.google_application_credential)
  spreadsheet = session.spreadsheet_by_title(Gaf.config.title_worksheet)
  @worksheet ||= spreadsheet.worksheets.last
  @sprint ||= Sprint.find_or_create_by name: worksheet.title
end