Class: FoxTail::IconComponent

Inherits:
IconBaseComponent show all
Defined in:
app/components/fox_tail/icon_component.rb

Overview

Displays an icon inline

Instance Attribute Summary collapse

Attributes inherited from IconBaseComponent

#name

Attributes inherited from InlineSvgComponent

#path

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from IconBaseComponent

#icon_set, #initialize, #path, #variant

Methods inherited from InlineSvgComponent

#initialize

Methods inherited from BaseComponent

classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::IconBaseComponent

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



6
7
8
# File 'app/components/fox_tail/icon_component.rb', line 6

def color
  @color
end

#sizeObject (readonly)

Returns the value of attribute size.



6
7
8
# File 'app/components/fox_tail/icon_component.rb', line 6

def size
  @size
end

Instance Method Details

#callObject



16
17
18
19
20
21
22
# File 'app/components/fox_tail/icon_component.rb', line 16

def call
  if shape?
     :div, super, class: theme.apply(:container, self)
  else
    super
  end
end

#shape?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/components/fox_tail/icon_component.rb', line 12

def shape?
  shape != "none"
end