Class: ActiveRecordDataLoader::Configuration
- Inherits:
-
Object
- Object
- ActiveRecordDataLoader::Configuration
- Defined in:
- lib/active_record_data_loader/configuration.rb
Instance Attribute Summary collapse
-
#connection_factory ⇒ Object
Returns the value of attribute connection_factory.
-
#default_batch_size ⇒ Object
Returns the value of attribute default_batch_size.
-
#default_row_count ⇒ Object
Returns the value of attribute default_row_count.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_duplicate_retries ⇒ Object
Returns the value of attribute max_duplicate_retries.
-
#output ⇒ Object
Returns the value of attribute output.
-
#raise_on_duplicates ⇒ Object
Returns the value of attribute raise_on_duplicates.
-
#statement_timeout ⇒ Object
Returns the value of attribute statement_timeout.
Instance Method Summary collapse
-
#initialize(default_batch_size: 100_000, default_row_count: 1, logger: nil, statement_timeout: "2min", connection_factory: -> { ::ActiveRecord::Base.connection }, raise_on_duplicates: false, max_duplicate_retries: 5, output: nil) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(default_batch_size: 100_000, default_row_count: 1, logger: nil, statement_timeout: "2min", connection_factory: -> { ::ActiveRecord::Base.connection }, raise_on_duplicates: false, max_duplicate_retries: 5, output: nil) ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_record_data_loader/configuration.rb', line 9 def initialize( default_batch_size: 100_000, default_row_count: 1, logger: nil, statement_timeout: "2min", connection_factory: -> { ::ActiveRecord::Base.connection }, raise_on_duplicates: false, max_duplicate_retries: 5, output: nil ) @default_batch_size = default_batch_size @default_row_count = default_row_count @logger = logger || default_logger @statement_timeout = statement_timeout @connection_factory = connection_factory @raise_on_duplicates = raise_on_duplicates @max_duplicate_retries = max_duplicate_retries self.output = output end |
Instance Attribute Details
#connection_factory ⇒ Object
Returns the value of attribute connection_factory.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def connection_factory @connection_factory end |
#default_batch_size ⇒ Object
Returns the value of attribute default_batch_size.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def default_batch_size @default_batch_size end |
#default_row_count ⇒ Object
Returns the value of attribute default_row_count.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def default_row_count @default_row_count end |
#logger ⇒ Object
Returns the value of attribute logger.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def logger @logger end |
#max_duplicate_retries ⇒ Object
Returns the value of attribute max_duplicate_retries.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def max_duplicate_retries @max_duplicate_retries end |
#output ⇒ Object
Returns the value of attribute output.
7 8 9 |
# File 'lib/active_record_data_loader/configuration.rb', line 7 def output @output end |
#raise_on_duplicates ⇒ Object
Returns the value of attribute raise_on_duplicates.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def raise_on_duplicates @raise_on_duplicates end |
#statement_timeout ⇒ Object
Returns the value of attribute statement_timeout.
5 6 7 |
# File 'lib/active_record_data_loader/configuration.rb', line 5 def statement_timeout @statement_timeout end |