Sha256: ec75ab063c1a38b9a4c468175da5ac0bd3b03867f0ddc3b7c490b526c50c9964

Contents?: true

Size: 709 Bytes

Versions: 9

Compression:

Stored size: 709 Bytes

Contents

require_relative 'mixins/event'
require_relative 'mixins/tooltips'

module Voom
  module Presenters
    module DSL
      module Components
        class Typography < EventBase
          include Mixins::Tooltips

          attr_accessor :text, :level, :color, :position

          def initialize(parent:, **attribs_, &block)
            super(type: :text, parent: parent, **attribs_, &block)
            @text = Array(attribs.delete(:text)||'').flatten.join("\n\n").split("\n\n")
            @level = attribs.delete(:level){1}
            @color = attribs.delete(:color)
            @position = Array(attribs.delete(:position)).compact
            expand!
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
voom-presenters-0.1.8 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.7 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.6 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.5 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.4 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.3 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.2 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.1 lib/voom/presenters/dsl/components/typography.rb
voom-presenters-0.1.0 lib/voom/presenters/dsl/components/typography.rb