Class: Sp2db::Config
- Inherits:
-
Object
- Object
- Sp2db::Config
- Defined in:
- lib/sp2db/config.rb
Constant Summary collapse
- DEFAULT =
{ personal_credential: "credentials/google_credentials.json", import_strategy: :truncate_all, export_location: "db/spreadsheets", default_file_extention: :csv, exception_handler: OpenStruct.new({ row_import_error: :raise, table_import_error: :raise, }), non_model_tables: {}.with_indifferent_access, download_before_import: false, default_extensions: :csv, default_find_columns: [:id], }
- SUPPORTED_EXTENSIONS =
[:csv]
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#credential ⇒ Object
Returns the value of attribute credential.
-
#default_extensions ⇒ Object
Returns the value of attribute default_extensions.
-
#default_file_extention ⇒ Object
Returns the value of attribute default_file_extention.
-
#default_find_columns ⇒ Object
Returns the value of attribute default_find_columns.
-
#download_before_import ⇒ Object
Returns the value of attribute download_before_import.
-
#exception_handler ⇒ Object
Returns the value of attribute exception_handler.
-
#export_location ⇒ Object
Returns the value of attribute export_location.
-
#import_strategy ⇒ Object
Returns the value of attribute import_strategy.
-
#non_model_tables ⇒ Object
Returns the value of attribute non_model_tables.
-
#personal_credential ⇒ Object
Returns the value of attribute personal_credential.
-
#spreadsheet_id ⇒ Object
Returns the value of attribute spreadsheet_id.
Instance Method Summary collapse
- #export_folder ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
37 38 39 |
# File 'lib/sp2db/config.rb', line 37 def initialize set_default end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def client_secret @client_secret end |
#credential ⇒ Object
Returns the value of attribute credential.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def credential @credential end |
#default_extensions ⇒ Object
Returns the value of attribute default_extensions.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def default_extensions @default_extensions end |
#default_file_extention ⇒ Object
Returns the value of attribute default_file_extention.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def default_file_extention @default_file_extention end |
#default_find_columns ⇒ Object
Returns the value of attribute default_find_columns.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def default_find_columns @default_find_columns end |
#download_before_import ⇒ Object
Returns the value of attribute download_before_import.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def download_before_import @download_before_import end |
#exception_handler ⇒ Object
Returns the value of attribute exception_handler.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def exception_handler @exception_handler end |
#export_location ⇒ Object
Returns the value of attribute export_location.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def export_location @export_location end |
#import_strategy ⇒ Object
Returns the value of attribute import_strategy.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def import_strategy @import_strategy end |
#non_model_tables ⇒ Object
Returns the value of attribute non_model_tables.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def non_model_tables @non_model_tables end |
#personal_credential ⇒ Object
Returns the value of attribute personal_credential.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def personal_credential @personal_credential end |
#spreadsheet_id ⇒ Object
Returns the value of attribute spreadsheet_id.
4 5 6 |
# File 'lib/sp2db/config.rb', line 4 def spreadsheet_id @spreadsheet_id end |
Instance Method Details
#export_folder ⇒ Object
47 48 49 50 |
# File 'lib/sp2db/config.rb', line 47 def export_folder FileUtils.mkdir_p export_location export_location end |