Class: Voom::Presenters::DSL::Components::Header
- Defined in:
- lib/voom/presenters/dsl/components/header.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
Returns the value of attribute image.
-
#title(*text, **attribs, &block) ⇒ Object
Returns the value of attribute title.
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ Header
constructor
A new instance of Header.
- #menu(**attribs, &block) ⇒ Object
Methods inherited from Base
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Header
Returns a new instance of Header.
8 9 10 11 12 13 14 15 |
# File 'lib/voom/presenters/dsl/components/header.rb', line 8 def initialize(**attribs_, &block) super(type: :header, context: context, **attribs_, &block) self.title(attribs.delete(:title)) if attribs.key?(:title) @image = attribs.delete(:image) end |
Instance Attribute Details
#image ⇒ Object
Returns the value of attribute image.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/header.rb', line 6 def image @image end |
#title(*text, **attribs, &block) ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/header.rb', line 6 def title @title end |
Instance Method Details
#menu(**attribs, &block) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/voom/presenters/dsl/components/header.rb', line 17 def (**attribs, &block) return if locked? = Menu.new(parent: self, context: context, **attribs, &block) end |