Module: OfflineLookup::Core
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/offline_lookup/core.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #add_to_offline_lookup ⇒ Object
- #offline_lookup_value ⇒ Object
- #set_class_offline_lookup_values ⇒ Object
Instance Method Details
#add_to_offline_lookup ⇒ Object
38 39 40 41 |
# File 'lib/offline_lookup/core.rb', line 38 def add_to_offline_lookup builder = OfflineLookup::DynamicModuleBuilder.new(self.class, self.) builder.add_dynamic_lookup_methods(self.attributes[self.[:key]], offline_lookup_value) end |
#offline_lookup_value ⇒ Object
34 35 36 |
# File 'lib/offline_lookup/core.rb', line 34 def offline_lookup_value self.class.offline_lookup_value(*[:fields].map{|f| self.attributes[f.to_s]}) end |
#set_class_offline_lookup_values ⇒ Object
30 31 32 |
# File 'lib/offline_lookup/core.rb', line 30 def set_class_offline_lookup_values self.class.offline_lookup_values = self.class.get_offline_lookup_values end |