Class: Icon::Component
- Inherits:
-
Lookbook::BaseComponent
- Object
- Lookbook::BaseComponent
- Icon::Component
- Defined in:
- app/components/lookbook/icon/component.rb
Constant Summary collapse
- ICON_CACHE =
{}
Instance Attribute Summary collapse
-
#stroke ⇒ Object
readonly
Returns the value of attribute stroke.
Instance Method Summary collapse
-
#initialize(name:, size: 4, stroke: 2, **html_attrs) ⇒ Component
constructor
A new instance of Component.
- #size_rems ⇒ Object
Constructor Details
#initialize(name:, size: 4, stroke: 2, **html_attrs) ⇒ Component
Returns a new instance of Component.
7 8 9 10 11 12 |
# File 'app/components/lookbook/icon/component.rb', line 7 def initialize(name:, size: 4, stroke: 2, **html_attrs) @icon_name = name.to_s.tr("_", "-") @size = size || 4 @stroke = stroke super(**html_attrs) end |
Instance Attribute Details
#stroke ⇒ Object (readonly)
Returns the value of attribute stroke.
5 6 7 |
# File 'app/components/lookbook/icon/component.rb', line 5 def stroke @stroke end |
Instance Method Details
#size_rems ⇒ Object
14 15 16 |
# File 'app/components/lookbook/icon/component.rb', line 14 def size_rems "#{@size * 0.25}rem" end |