class Voom::Presenters::DSL::Components::Typography
Attributes
color[RW]
inline[RW]
level[RW]
markdown[RW]
position[RW]
text[RW]
Public Class Methods
new(parent:, level: nil, **attribs_, &block)
click to toggle source
Calls superclass method
Voom::Presenters::DSL::Components::EventBase::new
# File lib/voom/presenters/dsl/components/typography.rb, line 10 def initialize(parent:, level: nil, **attribs_, &block) super(type: :text, parent: parent, **attribs_, &block) @text = Array(attribs.delete(:text)||'').flatten.join("\n\n").split("\n\n") @level = level @color = attribs.delete(:color) @inline = attribs.delete(:inline) { false } @position = Array(attribs.delete(:position)).compact @markdown = attribs.delete(:markdown) { true } expand! end
Public Instance Methods
icon(icon=nil, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/typography.rb, line 21 def icon(icon=nil, **attribs, &block) return @icon if locked? @icon = Components::Icon.new(parent: self, icon: icon, **attribs, &block) end