Class: Voom::Presenters::DSL::Components::Footer

Inherits:
Base
  • Object
show all
Defined in:
lib/voom/presenters/dsl/components/footer.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type

Instance Method Summary collapse

Methods inherited from Base

#expand!

Methods included from Pluggable

#include_plugins, #plugin, #plugin_module

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#locked?

Constructor Details

#initialize(type: nil, **attribs_, &block) ⇒ Footer

Returns a new instance of Footer.



8
9
10
11
12
13
# File 'lib/voom/presenters/dsl/components/footer.rb', line 8

def initialize(type: nil, **attribs_, &block)
  @footer_type = type ||  :small
  super(type: :footer, **attribs_, &block)
  @menus = []
  expand!
end

Instance Attribute Details

Returns the value of attribute footer_type.



6
7
8
# File 'lib/voom/presenters/dsl/components/footer.rb', line 6

def footer_type
  @footer_type
end

Returns the value of attribute menus.



6
7
8
# File 'lib/voom/presenters/dsl/components/footer.rb', line 6

def menus
  @menus
end

Instance Method Details



15
16
17
18
19
# File 'lib/voom/presenters/dsl/components/footer.rb', line 15

def menu(title=nil, **attribs, &block)
  return @menus if locked?
  @menus << Menu.new(title,parent: self,
                     **attribs, &block)
end