Class: Heroicons::ViewComponent::Icon
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Heroicons::ViewComponent::Icon
- Defined in:
- lib/heroicons/view_component/icon.rb
Constant Summary collapse
- VARIANTS =
["outline", "solid"].freeze
- SIZES =
["16", "20", "24"].freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name:, variant: "outline", size: "24", **html_options) ⇒ Icon
constructor
A new instance of Icon.
Constructor Details
#initialize(name:, variant: "outline", size: "24", **html_options) ⇒ Icon
Returns a new instance of Icon.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/heroicons/view_component/icon.rb', line 12 def initialize(name:, variant: "outline", size: "24", **) super() @name = name.to_s @variant = variant.to_s @size = size&.to_s @html_options = validate_variant! validate_size! end |
Instance Method Details
#call ⇒ Object
23 24 25 |
# File 'lib/heroicons/view_component/icon.rb', line 23 def call svg_content.html_safe end |