Sha256: 6ad2b03990445046d63ab39c299481022b13c9ce07d30f23818b34369813e420
Contents?: true
Size: 996 Bytes
Versions: 12
Compression:
Stored size: 996 Bytes
Contents
module Coprl module Presenters module DSL module Components class Typography < EventBase include Mixins::Tooltips attr_accessor :text, :level, :color, :position, :inline, :markdown 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 def icon(icon=nil, **attribs, &block) return @icon if locked? @icon = Components::Icon.new(parent: self, icon: icon, **attribs, &block) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems