Class: Irelia::Navbar::Brand::Component
- Inherits:
-
Component
- Object
- Component
- Irelia::Navbar::Brand::Component
- Defined in:
- app/components/irelia/navbar/brand/component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**options) ⇒ Component
constructor
A new instance of Component.
- #variants ⇒ Object
Constructor Details
#initialize(**options) ⇒ Component
Returns a new instance of Component.
13 14 15 16 17 18 |
# File 'app/components/irelia/navbar/brand/component.rb', line 13 def initialize(**) super @tag = @url.present? ? :a : :span @html_options[:href] = @url if @url.present? end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 |
# File 'app/components/irelia/navbar/brand/component.rb', line 20 def call content_tag(@tag, ) do content end end |
#variants ⇒ Object
6 7 8 9 10 11 |
# File 'app/components/irelia/navbar/brand/component.rb', line 6 def variants class_names( "irelia-navbar__brand", "irelia-navbar__brand--default": variant == :default ) end |