Class: Spotlight::SolrDocument::SpotlightImages::Versions

Inherits:
Object
  • Object
show all
Includes:
ImageDerivatives
Defined in:
app/models/concerns/spotlight/solr_document/spotlight_images.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#versionsObject (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