Class: Irelia::Sidebar::Brand::Component

Inherits:
Component
  • Object
show all
Defined in:
app/components/irelia/sidebar/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/sidebar/brand/component.rb', line 13

def initialize(**options)
  super

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

Instance Method Details

#variantsObject



6
7
8
9
10
11
# File 'app/components/irelia/sidebar/brand/component.rb', line 6

def variants
  class_names(
    "irelia-sidebar__brand",
    "irelia-sidebar__brand--default": variant == :default
  )
end