Class: Blacklight::Gallery::SlideshowComponent
- Inherits:
-
DocumentComponent
- Object
- DocumentComponent
- Blacklight::Gallery::SlideshowComponent
- Defined in:
- app/components/blacklight/gallery/slideshow_component.rb
Instance Method Summary collapse
- #count ⇒ Object
- #presenter ⇒ Object
- #render_document_class(*args) ⇒ Object
- #slideshow_image_url ⇒ Object
- #slideshow_tag(image_options = { alt: '' }) ⇒ Object
- #view_config ⇒ Object
Instance Method Details
#count ⇒ Object
6 7 8 |
# File 'app/components/blacklight/gallery/slideshow_component.rb', line 6 def count @document.response&.total end |
#presenter ⇒ Object
14 15 16 |
# File 'app/components/blacklight/gallery/slideshow_component.rb', line 14 def presenter @presenter ||= @view_context.document_presenter(@document) end |
#render_document_class(*args) ⇒ Object
10 11 12 |
# File 'app/components/blacklight/gallery/slideshow_component.rb', line 10 def render_document_class(*args) @view_context.render_document_class(*args) end |
#slideshow_image_url ⇒ Object
31 32 33 |
# File 'app/components/blacklight/gallery/slideshow_component.rb', line 31 def @document.first(view_config.) if @document.has? view_config. end |
#slideshow_tag(image_options = { alt: '' }) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/components/blacklight/gallery/slideshow_component.rb', line 18 def ( = { alt: '' }) if view_config. method_name = view_config. @view_context.send(method_name, @document, ) elsif view_config. return if .blank? image = image_tag , helpers.link_to_document(@document, image) elsif presenter.thumbnail.exists? presenter.thumbnail.thumbnail_tag() end end |
#view_config ⇒ Object
35 36 37 |
# File 'app/components/blacklight/gallery/slideshow_component.rb', line 35 def view_config presenter.thumbnail.view_config end |