Class: Layered::Ui::PopoverHelper::PopoverBuilder
- Inherits:
-
Object
- Object
- Layered::Ui::PopoverHelper::PopoverBuilder
- Defined in:
- app/helpers/layered/ui/popover_helper.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#trigger_html ⇒ Object
readonly
Returns the value of attribute trigger_html.
Instance Method Summary collapse
-
#initialize(view, id:) ⇒ PopoverBuilder
constructor
A new instance of PopoverBuilder.
- #trigger(**options, &block) ⇒ Object
Constructor Details
#initialize(view, id:) ⇒ PopoverBuilder
Returns a new instance of PopoverBuilder.
54 55 56 57 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 54 def initialize(view, id:) @view = view @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
52 53 54 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 52 def id @id end |
#trigger_html ⇒ Object (readonly)
Returns the value of attribute trigger_html.
52 53 54 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 52 def trigger_html @trigger_html end |
Instance Method Details
#trigger(**options, &block) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 59 def trigger(**, &block) = .deep_dup [:type] ||= "button" [:popovertarget] = id data = [:data] || {} data[:"l-ui--popover-target"] = "trigger" [:data] = data content = @view.capture(&block) @trigger_html = @view.tag.(content, **) nil end |