Class: Voom::Presenters::DSL::Components::Link
- Inherits:
-
Typography
- Object
- Base
- EventBase
- Typography
- Voom::Presenters::DSL::Components::Link
- Defined in:
- lib/voom/presenters/dsl/components/link.rb
Constant Summary collapse
- VALID_TARGETS =
%i[self blank].freeze
Instance Attribute Summary collapse
-
#target ⇒ Object
Returns the value of attribute target.
-
#text ⇒ Object
Returns the value of attribute text.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from Typography
#color, #inline, #level, #markdown, #position
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
-
#initialize(parent:, **attribs_, &block) ⇒ Link
constructor
A new instance of Link.
Methods inherited from Typography
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:, **attribs_, &block) ⇒ Link
Returns a new instance of Link.
10 11 12 13 14 15 16 17 18 |
# File 'lib/voom/presenters/dsl/components/link.rb', line 10 def initialize(parent:, **attribs_, &block) super(type: :link, parent: parent, **attribs_, &block) @url = attribs_.delete(:url) @text = attribs_.delete(:text) { url } @target = validate_target(attribs_.delete(:target) { :self }) end |
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/link.rb', line 6 def target @target end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/link.rb', line 6 def text @text end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/link.rb', line 6 def url @url end |