Module: LowCardTables::HasLowCardTable::Base::ClassMethods
- Defined in:
- lib/low_card_tables/has_low_card_table/base.rb
Instance Method Summary collapse
-
#_low_card_associations_manager ⇒ Object
The LowCardAssociationsManager keeps track of which low-card tables this table refers to; see its documentation for more information.
-
#_low_card_dynamic_method_manager ⇒ Object
The LowCardDynamicMethodManager is responsible for maintaining the right delegated method names in the _low_card_dynamic_methods_module; see its documentation for more information.
-
#_low_card_dynamic_methods_module ⇒ Object
This maintains a single module that gets included into this class; it is the place where we add all delegated methods.
-
#has_any_low_card_tables? ⇒ Boolean
This overrides the implementation in LowCardTables::ActiveRecord::Base – the only way we get included in a class is if that class has declared has_low_card_table to at least one table.
Instance Method Details
#_low_card_associations_manager ⇒ Object
The LowCardAssociationsManager keeps track of which low-card tables this table refers to; see its documentation for more information.
75 76 77 |
# File 'lib/low_card_tables/has_low_card_table/base.rb', line 75 def _low_card_associations_manager @_low_card_associations_manager ||= LowCardTables::HasLowCardTable::LowCardAssociationsManager.new(self) end |
#_low_card_dynamic_method_manager ⇒ Object
The LowCardDynamicMethodManager is responsible for maintaining the right delegated method names in the _low_card_dynamic_methods_module; see its documentation for more information.
81 82 83 |
# File 'lib/low_card_tables/has_low_card_table/base.rb', line 81 def _low_card_dynamic_method_manager @_low_card_dynamic_method_manager ||= LowCardTables::HasLowCardTable::LowCardDynamicMethodManager.new(self) end |
#_low_card_dynamic_methods_module ⇒ Object
This maintains a single module that gets included into this class; it is the place where we add all delegated methods. We use a module rather than defining them directly on this class so that users can still override them and use #super to call our implementation, if desired.
88 89 90 91 92 93 94 95 |
# File 'lib/low_card_tables/has_low_card_table/base.rb', line 88 def _low_card_dynamic_methods_module @_low_card_dynamic_methods_module ||= begin out = Module.new self.const_set(:LowCardDynamicMethods, out) include out out end end |
#has_any_low_card_tables? ⇒ Boolean
This overrides the implementation in LowCardTables::ActiveRecord::Base – the only way we get included in a class is if that class has declared has_low_card_table to at least one table.
69 70 71 |
# File 'lib/low_card_tables/has_low_card_table/base.rb', line 69 def has_any_low_card_tables? true end |