Module: Blacklight::Document::ClassMethods
- Defined in:
- app/models/concerns/blacklight/document.rb
Overview
Certain class-level methods needed for the document-specific extendability architecture
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#attribute(name, type, field) ⇒ Object
Define an attribute reader on a document model.
Instance Attribute Details
#unique_key ⇒ Object
144 145 146 |
# File 'app/models/concerns/blacklight/document.rb', line 144 def unique_key @unique_key ||= 'id' end |
Instance Method Details
#attribute(name, type, field) ⇒ Object
Define an attribute reader on a document model
158 159 160 161 162 |
# File 'app/models/concerns/blacklight/document.rb', line 158 def attribute(name, type, field) define_method name do type.coerce(self[field]) end end |