Class: Spotlight::SolrDocument::SpotlightImages::Versions
- Inherits:
-
Object
- Object
- Spotlight::SolrDocument::SpotlightImages::Versions
- Includes:
- ImageDerivatives
- Defined in:
- app/models/concerns/spotlight/solr_document/spotlight_images.rb
Instance Attribute Summary collapse
-
#versions ⇒ Object
readonly
Returns the value of attribute versions.
Instance Method Summary collapse
-
#initialize(document) ⇒ Versions
constructor
A new instance of Versions.
Methods included from ImageDerivatives
#apply_spotlight_image_derivative_versions
Constructor Details
#initialize(document) ⇒ Versions
Returns a new instance of Versions.
19 20 21 22 23 24 25 26 27 |
# File 'app/models/concerns/spotlight/solr_document/spotlight_images.rb', line 19 def initialize(document) @versions = spotlight_image_derivatives.map do |derivative| version = version_name(derivative) self.class.send(:define_method, version) do document[derivative[:field]] end version end end |
Instance Attribute Details
#versions ⇒ Object (readonly)
Returns the value of attribute versions.
17 18 19 |
# File 'app/models/concerns/spotlight/solr_document/spotlight_images.rb', line 17 def versions @versions end |