class Voom::Presenters::DSL::Components::Menu::Item

Attributes

disabled[RW]
selected[RW]
text[RW]

Public Class Methods

new(**attribs_, &block) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 81
def initialize(**attribs_, &block)
  super(type: :item, **attribs_, &block)
  @text = attribs.delete(:text)
  @disabled = attribs.delete(:disabled)
  @selected = attribs.delete(:selected) {false}
  @position = validate_position(attribs.delete(:position) { :top })
  @size = validate_size(attribs.delete(:size) { :normal })
  @color = attribs.delete(:color) { :primary }
  @components = []
  expand!
end

Public Instance Methods

icon(icon=nil, **attribs, &block) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 93
def icon(icon=nil, **attribs, &block)
  return @icon if locked?
  @icon = Icon.new(parent: self, icon: icon,
                   **attribs, &block)
end