Class: StimulusPlumbers::Components::Popover::Builder
- Inherits:
-
Object
- Object
- StimulusPlumbers::Components::Popover::Builder
- Defined in:
- lib/stimulus_plumbers/components/popover/renderer.rb
Instance Attribute Summary collapse
-
#activator_html ⇒ Object
readonly
Returns the value of attribute activator_html.
-
#content_html ⇒ Object
readonly
Returns the value of attribute content_html.
Instance Method Summary collapse
- #activator(&block) ⇒ Object
- #content(&block) ⇒ Object
-
#initialize(template) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(template) ⇒ Builder
Returns a new instance of Builder.
9 10 11 12 13 |
# File 'lib/stimulus_plumbers/components/popover/renderer.rb', line 9 def initialize(template) @template = template @activator_html = "".html_safe @content_html = "".html_safe end |
Instance Attribute Details
#activator_html ⇒ Object (readonly)
Returns the value of attribute activator_html.
7 8 9 |
# File 'lib/stimulus_plumbers/components/popover/renderer.rb', line 7 def activator_html @activator_html end |
#content_html ⇒ Object (readonly)
Returns the value of attribute content_html.
7 8 9 |
# File 'lib/stimulus_plumbers/components/popover/renderer.rb', line 7 def content_html @content_html end |
Instance Method Details
#activator(&block) ⇒ Object
15 16 17 |
# File 'lib/stimulus_plumbers/components/popover/renderer.rb', line 15 def activator(&block) @activator_html = @template.capture(&block) end |
#content(&block) ⇒ Object
19 20 21 |
# File 'lib/stimulus_plumbers/components/popover/renderer.rb', line 19 def content(&block) @content_html = @template.capture(&block) end |