Class: Practical::Views::ToastComponent

Inherits:
BaseComponent
  • Object
show all
Includes:
Button::Styling
Defined in:
app/components/practical/views/toast_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ElementHelper

#grab, #mix

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 = options
  initialize_style_utilities(appearance: appearance, color_variant: color_variant, size: size)
end

Instance Attribute Details

#appearanceObject

Returns the value of attribute appearance.



5
6
7
# File 'app/components/practical/views/toast_component.rb', line 5

def appearance
  @appearance
end

#color_variantObject

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

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'app/components/practical/views/toast_component.rb', line 5

def options
  @options
end

#sizeObject

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_optionsObject



14
15
16
17
18
# File 'app/components/practical/views/toast_component.rb', line 14

def finalized_callout_options
  mix({
    class: class_names("wa-callout", css_classes_from_style_utilities)
  }, options)
end