Method: CLI::UI::Glyph#initialize

Defined in:
lib/cli/ui/glyph.rb

#initialize(handle, codepoint, plain, color) ⇒ Glyph

Returns a new instance of Glyph.



46
47
48
49
50
51
52
53
54
55
# File 'lib/cli/ui/glyph.rb', line 46

def initialize(handle, codepoint, plain, color)
  @handle    = handle
  @codepoint = codepoint
  @color     = color
  @char      = CLI::UI::OS.current.use_emoji? ? Array(codepoint).pack('U*') : plain
  @to_s      = color.code + @char + Color::RESET.code
  @fmt       = "{{#{color.name}:#{@char}}}"

  MAP[handle] = self
end