Sha256: 411b9805985a85afeac2452ca93c5046a47581883110953d456a4717d5e2423e

Contents?: true

Size: 428 Bytes

Versions: 4

Compression:

Stored size: 428 Bytes

Contents

require 'virtus'

require_relative '../support/cursor'
require_relative '../support/esc'
require_relative 'coercions'

module Vedeu
  class StyleCollection < Virtus::Attribute
    include Coercions

    def coerce(values)
      return '' if empty?(values)

      if multiple?(values)
        values.map { |value| Esc.stylize(value) }.join

      elsif just_text?(values)
        Esc.stylize(values)

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.0.29 lib/vedeu/models/style_collection.rb
vedeu-0.0.28 lib/vedeu/models/style_collection.rb
vedeu-0.0.27 lib/vedeu/models/style_collection.rb
vedeu-0.0.26 lib/vedeu/models/style_collection.rb