Class: Essence::ExpandableComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Essence::ExpandableComponent
- Defined in:
- app/components/essence/expandable_component.rb
Constant Summary collapse
- DEFAULT_EXPANDED =
false
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Attribute Summary collapse
-
#html_options ⇒ Object
readonly
Returns the value of attribute html_options.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, expanded: DEFAULT_EXPANDED, **html_options) ⇒ ExpandableComponent
constructor
A new instance of ExpandableComponent.
Methods inherited from ApplicationComponent
Methods included from Utils
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #integer_or_fallback
Constructor Details
#initialize(name:, expanded: DEFAULT_EXPANDED, **html_options) ⇒ ExpandableComponent
Returns a new instance of ExpandableComponent.
9 10 11 12 13 14 15 |
# File 'app/components/essence/expandable_component.rb', line 9 def initialize(name:, expanded: DEFAULT_EXPANDED, **) @name = name = fetch_or_fallback_boolean(, fallback: DEFAULT_EXPANDED) = end |
Instance Attribute Details
#html_options ⇒ Object (readonly)
Returns the value of attribute html_options.
5 6 7 |
# File 'app/components/essence/expandable_component.rb', line 5 def end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'app/components/essence/expandable_component.rb', line 5 def name @name end |