Class: Irelia::Navbar::Brand::Component

Inherits:
Component
  • Object
show all
Defined in:
app/components/irelia/navbar/brand/component.rb

Instance Method Summary collapse

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(**options)
  super

  @tag = @url.present? ? :a : :span
  @html_options[:href] = @url if @url.present?
end

Instance Method Details

#callObject



20
21
22
23
24
# File 'app/components/irelia/navbar/brand/component.rb', line 20

def call
  (@tag, html_options) do
    content
  end
end

#variantsObject



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