Class: GoogleSpreadsheetFetcher::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/google_spreadsheet_fetcher/fetcher.rb

Constant Summary collapse

OOB_URI =
'urn:ietf:wg:oauth:2.0:oob'

Instance Method Summary collapse

Constructor Details

#initialize(spreadsheet_id, user_id, config: nil, application_name: nil) ⇒ Fetcher

Returns a new instance of Fetcher.

Parameters:



12
13
14
15
16
17
# File 'lib/google_spreadsheet_fetcher/fetcher.rb', line 12

def initialize(spreadsheet_id, user_id, config: nil, application_name: nil)
  @spreadsheet_id = spreadsheet_id
  @user_id = user_id
  @config = config
  @application_name = application_name
end

Instance Method Details

#fetch_all_rows_by!(index: nil, sheet_id: nil, title: nil, skip: 0, structured: false) ⇒ Object



19
20
21
22
# File 'lib/google_spreadsheet_fetcher/fetcher.rb', line 19

def fetch_all_rows_by!(index: nil, sheet_id: nil, title: nil, skip: 0, structured: false)
  sheet = fetch_sheet_by!(index: index, sheet_id: sheet_id, title: title)
  fetch_all_rows(sheet, skip: skip, structured: structured)
end

#serviceObject



24
25
26
# File 'lib/google_spreadsheet_fetcher/fetcher.rb', line 24

def service
  @service ||= GoogleSpreadsheetFetcher::SheetsServiceBuilder.new(@user_id, config: @config, application_name: @application_name).build
end