Class: Blacklight::Oembed::DocumentOembedComponent
- Inherits:
-
Component
- Object
- Component
- Blacklight::Oembed::DocumentOembedComponent
- Defined in:
- app/components/blacklight/oembed/document_oembed_component.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
Instance Method Summary collapse
- #embed ⇒ Object
-
#initialize(document:, presenter:, classes: ['oembed-widget'], **kwargs) ⇒ DocumentOembedComponent
constructor
A new instance of DocumentOembedComponent.
- #render? ⇒ Boolean
Constructor Details
#initialize(document:, presenter:, classes: ['oembed-widget'], **kwargs) ⇒ DocumentOembedComponent
Returns a new instance of DocumentOembedComponent.
6 7 8 9 10 11 12 |
# File 'app/components/blacklight/oembed/document_oembed_component.rb', line 6 def initialize(document:, presenter:, classes: ['oembed-widget'], **kwargs) super @document = document @presenter = presenter @classes = classes end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
4 5 6 |
# File 'app/components/blacklight/oembed/document_oembed_component.rb', line 4 def classes @classes end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
4 5 6 |
# File 'app/components/blacklight/oembed/document_oembed_component.rb', line 4 def document @document end |
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
4 5 6 |
# File 'app/components/blacklight/oembed/document_oembed_component.rb', line 4 def presenter @presenter end |
Instance Method Details
#embed ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/components/blacklight/oembed/document_oembed_component.rb', line 14 def return if .blank? @embed ||= if Blacklight::Oembed::Engine.config.render_helper != :render_oembed_tag_async && Blacklight::Oembed::Engine.config.render_helper != :render_oembed_tag_embed elsif view_config. || Blacklight::Oembed::Engine.config.render_helper == :render_oembed_tag_async else end end |
#render? ⇒ Boolean
26 27 28 |
# File 'app/components/blacklight/oembed/document_oembed_component.rb', line 26 def render? .present? end |