Class: RubyUI::SidebarMenuSubButton
- Defined in:
- lib/ruby_ui/sidebar/sidebar_menu_sub_button.rb
Constant Summary collapse
- SIZE_CLASSES =
{ sm: "text-xs", md: "text-sm" }.freeze
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(as: :button, size: :md, active: false, **attrs) ⇒ SidebarMenuSubButton
constructor
A new instance of SidebarMenuSubButton.
- #view_template ⇒ Object
Constructor Details
#initialize(as: :button, size: :md, active: false, **attrs) ⇒ SidebarMenuSubButton
Returns a new instance of SidebarMenuSubButton.
10 11 12 13 14 15 16 17 |
# File 'lib/ruby_ui/sidebar/sidebar_menu_sub_button.rb', line 10 def initialize(as: :button, size: :md, active: false, **attrs) raise ArgumentError, "Invalid size: #{size}" unless SIZE_CLASSES.key?(size) @as = as @size = size @active = active super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
19 20 21 |
# File 'lib/ruby_ui/sidebar/sidebar_menu_sub_button.rb', line 19 def view_template(&) tag(@as, **attrs, &) end |