Class: StimulusPlumbers::Components::Popover::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/stimulus_plumbers/components/popover/renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_htmlObject (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_htmlObject (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