Class: Voom::Presenters::DSL::Components::Tooltip
- Defined in:
- lib/voom/presenters/dsl/components/tooltip.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ Tooltip
constructor
A new instance of Tooltip.
- #text(*text, **attribs, &block) ⇒ Object
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(**attribs_, &block) ⇒ Tooltip
Returns a new instance of Tooltip.
8 9 10 11 12 13 14 |
# File 'lib/voom/presenters/dsl/components/tooltip.rb', line 8 def initialize(**attribs_, &block) super(type: :tooltip, **attribs_, &block) @position = attribs.delete(:position){ :left } self.text(attribs.delete(:text)) if attribs.key?(:text) end |
Instance Attribute Details
#position ⇒ Object (readonly)
Returns the value of attribute position.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/tooltip.rb', line 6 def position @position end |
Instance Method Details
#text(*text, **attribs, &block) ⇒ Object
16 17 18 19 |
# File 'lib/voom/presenters/dsl/components/tooltip.rb', line 16 def text(*text, **attribs, &block) return @text if locked? @text = Components::Typography.new(parent: self, type: :text, text: text, **attribs, &block) end |