Class: Pageflow::ThumbnailFileResolver
- Inherits:
-
Struct
- Object
- Struct
- Pageflow::ThumbnailFileResolver
- Defined in:
- app/models/pageflow/thumbnail_file_resolver.rb
Instance Attribute Summary collapse
-
#candidates ⇒ Object
Returns the value of attribute candidates.
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#entry ⇒ Object
Returns the value of attribute entry.
Instance Method Summary collapse
Instance Attribute Details
#candidates ⇒ Object
Returns the value of attribute candidates
2 3 4 |
# File 'app/models/pageflow/thumbnail_file_resolver.rb', line 2 def candidates @candidates end |
#configuration ⇒ Object
Returns the value of attribute configuration
2 3 4 |
# File 'app/models/pageflow/thumbnail_file_resolver.rb', line 2 def configuration @configuration end |
#entry ⇒ Object
Returns the value of attribute entry
2 3 4 |
# File 'app/models/pageflow/thumbnail_file_resolver.rb', line 2 def entry @entry end |
Instance Method Details
#find_thumbnail ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/models/pageflow/thumbnail_file_resolver.rb', line 3 def find_thumbnail candidates.detect do |candidate| condition = candidate[:unless] || candidate[:if] next if condition && !condition_met?(condition, candidate[:unless]) file = find_positioned_file_by_candiate(candidate) break file if file end || PositionedFile.null end |