Class: FoxTail::IconComponent
- Inherits:
-
IconBaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- InlineSvgComponent
- IconBaseComponent
- FoxTail::IconComponent
- Defined in:
- app/components/fox_tail/icon_component.rb
Overview
Displays an icon inline
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from IconBaseComponent
Attributes inherited from InlineSvgComponent
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from IconBaseComponent
#icon_set, #initialize, #path, #variant
Methods inherited from InlineSvgComponent
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::IconBaseComponent
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
6 7 8 |
# File 'app/components/fox_tail/icon_component.rb', line 6 def color @color end |
#size ⇒ Object (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
#call ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/components/fox_tail/icon_component.rb', line 16 def call if shape? content_tag :div, super, class: theme.apply(:container, self) else super end end |
#shape? ⇒ Boolean
12 13 14 |
# File 'app/components/fox_tail/icon_component.rb', line 12 def shape? shape != "none" end |