Class: Voom::Presenters::DSL::Components::Base
- Inherits:
-
Object
- Object
- Voom::Presenters::DSL::Components::Base
- Extended by:
- Pluggable
- Includes:
- LoggerMethods, Mixins::YieldTo, Lockable, Serializer, Trace
- Defined in:
- lib/voom/presenters/dsl/components/base.rb
Overview
Every object in the POM is a node This class provides common base implementation
Direct Known Subclasses
Actions::Base, Card::Actions, Card::Media, Dialog::Actions, Drawer, Event, EventBase, Footer, Header, ImageList, List, Lists::Action, Lists::Actions, Lists::Separator, Menu, Menu::Divider, Page, Progress, Select::Option, Separator, Snackbar, Stepper, Stepper::Step::Actions, TabBar, Table, Table::Pagination, Table::Row, Tooltip, UnorderedList, UnorderedList::ListItem
Instance Attribute Summary collapse
-
#attributes ⇒ Object
(also: #attribs)
readonly
Returns the value of attribute attributes.
-
#css_class ⇒ Object
readonly
Returns the value of attribute css_class.
-
#draggable ⇒ Object
readonly
Returns the value of attribute draggable.
-
#drop_zone ⇒ Object
readonly
Returns the value of attribute drop_zone.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #expand! ⇒ Object
-
#initialize(type:, parent:, id: nil, tag: nil, **attributes, &block) ⇒ Base
constructor
A new instance of Base.
Methods included from Pluggable
include_plugins, plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(type:, parent:, id: nil, tag: nil, **attributes, &block) ⇒ Base
Returns a new instance of Base.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 22 def initialize(type:, parent:, id: nil, tag: nil, **attributes, &block) @draggable = attributes.delete(:draggable) {nil} @drop_zone = attributes.delete(:drop_zone) {nil} @css_class = Array(attributes.delete(:class) {nil}) @id = id || generate_id @tag = tag @type = type @parent = parent @attributes = attributes @block = block initialize_plugins end |
Instance Attribute Details
#attributes ⇒ Object (readonly) Also known as: attribs
Returns the value of attribute attributes.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def attributes @attributes end |
#css_class ⇒ Object (readonly)
Returns the value of attribute css_class.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def css_class @css_class end |
#draggable ⇒ Object (readonly)
Returns the value of attribute draggable.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def draggable @draggable end |
#drop_zone ⇒ Object (readonly)
Returns the value of attribute drop_zone.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def drop_zone @drop_zone end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def id @id end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def tag @tag end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
18 19 20 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 18 def type @type end |
Instance Method Details
#expand! ⇒ Object
35 36 37 38 |
# File 'lib/voom/presenters/dsl/components/base.rb', line 35 def extend(_helpers_) if _helpers_ instance_eval(&@block) if @block end |