Class: Voom::Presenters::DSL::Components::PageTitle
- Inherits:
-
Typography
- Object
- Base
- EventBase
- Typography
- Voom::Presenters::DSL::Components::PageTitle
- Defined in:
- lib/voom/presenters/dsl/components/page_title.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
Attributes inherited from Typography
#color, #inline, #level, #markdown, #position, #text
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #icon(icon = nil, **attribs, &block) ⇒ Object
-
#initialize(parent:, level: nil, **attribs_, &block) ⇒ PageTitle
constructor
A new instance of PageTitle.
Methods included from Mixins::Buttons
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
Methods included from Mixins::Grids
Methods included from Mixins::Tooltips
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
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
#components ⇒ Object
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 |