Class: PhlexUI::Link

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/link.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template

Constructor Details

#initialize(href: "#", variant: :link, size: :md, icon: false, **attrs) ⇒ Link

Returns a new instance of Link.



5
6
7
8
9
10
11
# File 'lib/phlex_ui/link.rb', line 5

def initialize(href: "#", variant: :link, size: :md, icon: false, **attrs)
  @href = href
  @variant = variant.to_sym
  @size = size.to_sym
  @icon = icon
  super(**attrs)
end

Instance Method Details

#view_templateObject



13
14
15
# File 'lib/phlex_ui/link.rb', line 13

def view_template(&)
  a(href: @href, **attrs, &)
end