Class: GoogleSpreadsheetFetcher::Fetcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Fetcher.

Parameters:



7
8
9
10
11
12
# File 'lib/google_spreadsheet_fetcher/fetcher.rb', line 7

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



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

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



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

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