Class: Essence::IconComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Essence::IconComponent
- Defined in:
- app/components/essence/icon_component.rb
Constant Summary collapse
- NAME_OPTIONS =
get_directory_file_names(images_directory, :svg).sort.freeze
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
Instance Method Summary collapse
-
#initialize(name:, **html_options) ⇒ IconComponent
constructor
A new instance of IconComponent.
Methods inherited from ApplicationComponent
#assets_path, assets_path, images_directory
Methods included from Utils
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #integer_or_fallback
Constructor Details
#initialize(name:, **html_options) ⇒ IconComponent
Returns a new instance of IconComponent.
9 10 11 12 13 |
# File 'app/components/essence/icon_component.rb', line 9 def initialize(name:, **) @name = fetch_or_fallback(NAME_OPTIONS, name.to_s.underscore) @html_options = end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'app/components/essence/icon_component.rb', line 5 def file @file end |
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
5 6 7 |
# File 'app/components/essence/icon_component.rb', line 5 def @html_options end |