Class: Voom::Presenters::DSL::Components::PageTitle

Inherits:
Typography show all
Includes:
Mixins::Append, Mixins::Buttons, Mixins::Grids, Mixins::Icons, Mixins::Typography
Defined in:
lib/voom/presenters/dsl/components/page_title.rb

Instance Attribute Summary collapse

Attributes inherited from Typography

#color, #inline, #level, #markdown, #position, #text

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

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

Instance Method Summary collapse

Methods included from Mixins::Buttons

#button

Methods included from Mixins::Typography

#blank, #body, #body2, #caption, #headline, #headline1, #headline2, #headline3, #headline4, #headline5, #headline6, #link, #overline, #page_title, #separator, #subtitle, #subtitle2, #text, #title

Methods included from Mixins::Append

#<<, #yield_to

Methods included from Mixins::Grids

#grid

Methods included from Mixins::Tooltips

#tooltip

Methods included from Mixins::Event

#event

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(parent:, level: nil, **attribs_, &block) ⇒ PageTitle

Returns a new instance of PageTitle.



14
15
16
17
18
19
20
21
# File 'lib/voom/presenters/dsl/components/page_title.rb', line 14

def initialize(parent:, level: nil, **attribs_, &block)
  @components = []
  super(type: :page_title,
        parent: parent,
        level: level,
        **attribs_, &block)
  self.icon(attribs.delete(:icon)) if attribs.key?(:icon)
end

Instance Attribute Details

#componentsObject

Returns the value of attribute components.



12
13
14
# File 'lib/voom/presenters/dsl/components/page_title.rb', line 12

def components
  @components
end

Instance Method Details

#icon(icon = nil, **attribs, &block) ⇒ Object



23
24
25
26
# File 'lib/voom/presenters/dsl/components/page_title.rb', line 23

def icon(icon = nil, **attribs, &block)
  self << Components::Icon.new(parent: self, icon: icon,
                               **attribs, &block)
end