Class: NcsNavigator::Warehouse::Transformers::ForeignKeyIndex::StaticKeyProvider
- Inherits:
-
Object
- Object
- NcsNavigator::Warehouse::Transformers::ForeignKeyIndex::StaticKeyProvider
- Defined in:
- lib/ncs_navigator/warehouse/transformers/foreign_key_index/static_key_provider.rb
Overview
An existing key provider for NcsNavigator::Warehouse::Transformers::ForeignKeyIndex that uses a statically configured hash of keys.
Instance Attribute Summary collapse
-
#known_keys ⇒ Object
Returns the value of attribute known_keys.
Instance Method Summary collapse
- #existing_keys(model_class) ⇒ Object
-
#initialize(known_keys = {}) ⇒ StaticKeyProvider
constructor
A new instance of StaticKeyProvider.
Constructor Details
#initialize(known_keys = {}) ⇒ StaticKeyProvider
Returns a new instance of StaticKeyProvider.
11 12 13 |
# File 'lib/ncs_navigator/warehouse/transformers/foreign_key_index/static_key_provider.rb', line 11 def initialize(known_keys={}) @known_keys = known_keys end |
Instance Attribute Details
#known_keys ⇒ Object
Returns the value of attribute known_keys.
9 10 11 |
# File 'lib/ncs_navigator/warehouse/transformers/foreign_key_index/static_key_provider.rb', line 9 def known_keys @known_keys end |
Instance Method Details
#existing_keys(model_class) ⇒ Object
15 16 17 18 19 |
# File 'lib/ncs_navigator/warehouse/transformers/foreign_key_index/static_key_provider.rb', line 15 def existing_keys(model_class) # validation is to help with the uses of this class in specs fail 'model_class must be a string' unless Class === model_class known_keys[model_class.to_s] end |