class Ruboty::GoogleSpreadsheet::Spreadsheet

Public Class Methods

new(attrs = {}) click to toggle source
# File lib/ruboty/google_spreadsheet/spreadsheet.rb, line 6
def initialize(attrs = {})
  @access_token = attrs[:access_token]
  @key = attrs[:spreadsheet_key]
  @worksheets = []
end

Public Instance Methods

[](index) click to toggle source
# File lib/ruboty/google_spreadsheet/spreadsheet.rb, line 12
def [](index)
  @worksheets[index] ||= session.spreadsheet_by_key(@key).worksheets[index]
end
synchronize() click to toggle source
# File lib/ruboty/google_spreadsheet/spreadsheet.rb, line 16
def synchronize
  @worksheets.compact.each(&:synchronize)
end

Private Instance Methods

session() click to toggle source
# File lib/ruboty/google_spreadsheet/spreadsheet.rb, line 22
def session
  @session ||= GoogleDrive.login_with_oauth(@access_token)
end