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.
50 51 52 53 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 50 def initialize(view, id:) @view = view @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
48 49 50 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 48 def id @id end |
#trigger_html ⇒ Object (readonly)
Returns the value of attribute trigger_html.
48 49 50 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 48 def trigger_html @trigger_html end |
Instance Method Details
#trigger(**options, &block) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'app/helpers/layered/ui/popover_helper.rb', line 55 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 |