Class: QuickCount::Adapters::Base
- Inherits:
-
Object
- Object
- QuickCount::Adapters::Base
- Defined in:
- lib/quick_count/adapters/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #count_estimate(query) ⇒ Object
-
#initialize(connection:) ⇒ Base
constructor
A new instance of Base.
-
#quick_count(table_name, threshold: nil) ⇒ Object
Abstract methods that must be implemented by adapters.
- #supported? ⇒ Boolean
Constructor Details
#initialize(connection:) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/quick_count/adapters/base.rb', line 6 def initialize(connection:) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/quick_count/adapters/base.rb', line 4 def connection @connection end |
Instance Method Details
#count_estimate(query) ⇒ Object
15 16 17 |
# File 'lib/quick_count/adapters/base.rb', line 15 def count_estimate(query) raise NotImplementedError, "#{self.class} must implement #count_estimate" end |
#quick_count(table_name, threshold: nil) ⇒ Object
Abstract methods that must be implemented by adapters
11 12 13 |
# File 'lib/quick_count/adapters/base.rb', line 11 def quick_count(table_name, threshold: nil) raise NotImplementedError, "#{self.class} must implement #quick_count" end |
#supported? ⇒ Boolean
19 20 21 |
# File 'lib/quick_count/adapters/base.rb', line 19 def supported? raise NotImplementedError, "#{self.class} must implement #supported?" end |