Class: RUI::Links::Base
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(href: "#", icon: nil, **attrs) ⇒ Base
constructor
A new instance of Base.
- #view_template ⇒ Object
Constructor Details
#initialize(href: "#", icon: nil, **attrs) ⇒ Base
Returns a new instance of Base.
4 5 6 7 8 |
# File 'lib/rui/links/base.rb', line 4 def initialize(href: "#", icon: nil, **attrs) @href = href @icon = icon @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rui/links/base.rb', line 10 def view_template div do a(href: @href, class: classes, **@attrs) do div(class: "flex flex-row items-center gap-2") do if @icon div(class: "size-4 my-1") do render RUI::Icon.new(@icon) end end span { yield } if block_given? end end end end |