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

Attributes

color[RW]
hoisted[RW]
items[RW]
open[RW]
placement[RW]
position[RW]
title[RW]

Public Class Methods

new(title=nil, **attribs_, &block) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 8
def initialize(title=nil, **attribs_, &block)
  super(type: :menu, **attribs_, &block)
  @title = title
  @items = []
  @position = attribs.delete(:position){:left}
  @placement = attribs.delete(:placement){:default}
  @color = attribs.delete(:color)
  @open = attributes.delete(:open) {false}
  @hoisted = attributes.delete(:hoisted) {true}
  expand!
end

Public Instance Methods

divider(**attribs, &block) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 26
def divider(**attribs, &block)
  @items << Divider.new(parent: self,
                        **attribs, &block)
end
item(first_text = nil, text: nil, **attribs, &block) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 20
def item(first_text = nil, text: nil, **attribs, &block)
  the_text = first_text || text
  @items << Item.new(parent: self, text: the_text,
                     **attribs, &block)
end
label(**attribs, &block) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 31
def label(**attribs, &block)
  return @label if locked?
  @label = Label.new(parent: self,
                     **attribs, &block)
end