Class: Practical::Views::ToastComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Practical::Views::ToastComponent
- Includes:
- Button::Styling
- Defined in:
- app/components/practical/views/toast_component.rb
Instance Attribute Summary collapse
-
#appearance ⇒ Object
Returns the value of attribute appearance.
-
#color_variant ⇒ Object
Returns the value of attribute color_variant.
-
#options ⇒ Object
Returns the value of attribute options.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #finalized_callout_options ⇒ Object
-
#initialize(appearance: nil, color_variant: nil, size: nil, options: {}) ⇒ ToastComponent
constructor
A new instance of ToastComponent.
Methods included from ElementHelper
Constructor Details
#initialize(appearance: nil, color_variant: nil, size: nil, options: {}) ⇒ ToastComponent
Returns a new instance of ToastComponent.
9 10 11 12 |
# File 'app/components/practical/views/toast_component.rb', line 9 def initialize(appearance: nil, color_variant: nil, size: nil, options: {}) @options = initialize_style_utilities(appearance: appearance, color_variant: color_variant, size: size) end |
Instance Attribute Details
#appearance ⇒ Object
Returns the value of attribute appearance.
5 6 7 |
# File 'app/components/practical/views/toast_component.rb', line 5 def appearance @appearance end |
#color_variant ⇒ Object
Returns the value of attribute color_variant.
5 6 7 |
# File 'app/components/practical/views/toast_component.rb', line 5 def color_variant @color_variant end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'app/components/practical/views/toast_component.rb', line 5 def @options end |
#size ⇒ Object
Returns the value of attribute size.
5 6 7 |
# File 'app/components/practical/views/toast_component.rb', line 5 def size @size end |
Instance Method Details
#finalized_callout_options ⇒ Object
14 15 16 17 18 |
# File 'app/components/practical/views/toast_component.rb', line 14 def mix({ class: class_names("wa-callout", css_classes_from_style_utilities) }, ) end |