Class: DataSpork::Importer::GoogleSpreadsheet
Defined Under Namespace
Classes: Reader
Constant Summary
ENCODE_VALUES, SANITIZE_VALUES, VERBOSE, VERBOSE_IO_OPTIONS
Instance Attribute Summary
#blank_row, #col_map, #col_num, #col_tags, #effective_date, #headers, #input_type, #options, #root_tag, #row, #row_num, #row_tag, #setup_state, #writers
Instance Method Summary
collapse
#add_writers, #append, #clip_effective_date?, #col_value, convert, #convert, #csv?, #each, #effective_date_pattern, #file_modifier, #finish, #get_substitute_value, #header, #headers?, #init_writers, #initialize, #input_pathname, #on_begin_row, #on_end_row, #on_output_column, #output, #output_column?, #output_filename, #output_pathname, #print, #print_error, #put_row, #reject?, #sanitize, #sanitize_value, #setup, #setup_writers, #source_name, #start, #substitute_value, #write, #xlsx?
Instance Method Details
#google ⇒ Object
28
29
30
|
# File 'lib/data_spork/google_spreadsheet.rb', line 28
def google
options[:google]
end
|
#google? ⇒ Boolean
24
25
26
|
# File 'lib/data_spork/google_spreadsheet.rb', line 24
def google?
[ :google, :drive ].include?(input_type)
end
|
#google_password ⇒ Object
36
37
38
|
# File 'lib/data_spork/google_spreadsheet.rb', line 36
def google_password
google[:password]
end
|
#google_user ⇒ Object
32
33
34
|
# File 'lib/data_spork/google_spreadsheet.rb', line 32
def google_user
google[:user]
end
|
#init_options(options) ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/data_spork/google_spreadsheet.rb', line 6
def init_options(options)
super
unless @options[:google].present?
@options[:google] = {
user: ENV['google_user'],
password: ENV['google_pwd']
}
end
end
|
#reader ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/data_spork/google_spreadsheet.rb', line 16
def reader
if google?
Reader.new(self)
else
super
end
end
|
#spreadsheet_title ⇒ Object
40
41
42
|
# File 'lib/data_spork/google_spreadsheet.rb', line 40
def spreadsheet_title
google[:spreadsheet_title]
end
|
#worksheet_title ⇒ Object
44
45
46
|
# File 'lib/data_spork/google_spreadsheet.rb', line 44
def worksheet_title
google[:worksheet_title]
end
|