Class: RubyUI::ToastAction

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ui/toast/toast_action.rb

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

#initialize(label:, on: nil, **attrs) ⇒ ToastAction

Returns a new instance of ToastAction.



5
6
7
8
9
# File 'lib/ruby_ui/toast/toast_action.rb', line 5

def initialize(label:, on: nil, **attrs)
  @label = label
  @on = on
  super(**attrs)
end

Instance Method Details

#view_templateObject



11
12
13
# File 'lib/ruby_ui/toast/toast_action.rb', line 11

def view_template
  button(**attrs) { @label }
end