Sha256: 974e7d9d2dbf281fa9ab1cd0a8b72298c0e4ad3232cb6e0614e6dab2cafb8b9d
Contents?: true
Size: 709 Bytes
Versions: 14
Compression:
Stored size: 709 Bytes
Contents
module Vedeu class Base class << self def escape_sequence(colour = nil) new(colour).escape_sequence end end def initialize(colour = nil) @colour = colour end def escape_sequence [Esc.esc, prefix, code, suffix].join end private attr_reader :colour def code no_colour || named || html || default end def no_colour default unless colour end def named codes[colour] || codes[:default] if named? end def named? colour.is_a?(Symbol) end def html Translator.translate(colour) end def default codes[:default] end def suffix 'm' end end end
Version data entries
14 entries across 14 versions & 1 rubygems