Class: Voom::Presenters::DSL::Components::Menu
- Defined in:
- lib/voom/presenters/dsl/components/menu.rb
Defined Under Namespace
Modules: BaseMenuItem Classes: Divider, Item, Label
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#hoisted ⇒ Object
Returns the value of attribute hoisted.
-
#items ⇒ Object
Returns the value of attribute items.
-
#open ⇒ Object
Returns the value of attribute open.
-
#placement ⇒ Object
Returns the value of attribute placement.
-
#position ⇒ Object
Returns the value of attribute position.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #divider(**attribs, &block) ⇒ Object
-
#initialize(title = nil, **attribs_, &block) ⇒ Menu
constructor
A new instance of Menu.
- #item(first_text = nil, text: nil, **attribs, &block) ⇒ Object
- #label(**attribs, &block) ⇒ Object
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Voom::Presenters::DSL::Components::Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(title = nil, **attribs_, &block) ⇒ Menu
Returns a new instance of Menu.
8 9 10 11 12 13 14 15 16 17 18 |
# 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} end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def color @color end |
#hoisted ⇒ Object
Returns the value of attribute hoisted.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def hoisted @hoisted end |
#items ⇒ Object
Returns the value of attribute items.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def items @items end |
#open ⇒ Object
Returns the value of attribute open.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def open @open end |
#placement ⇒ Object
Returns the value of attribute placement.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def placement @placement end |
#position ⇒ Object
Returns the value of attribute position.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def position @position end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 6 def title @title end |
Instance Method Details
#divider(**attribs, &block) ⇒ Object
26 27 28 29 |
# File 'lib/voom/presenters/dsl/components/menu.rb', line 26 def divider(**attribs, &block) @items << Divider.new(parent: self, **attribs, &block) end |