class Dex::UI::Glyph

Constants

CHECK
INFO
MAP
QUESTION
STAR
X

Attributes

char[R]
codepoint[R]
color[R]
fmt[R]
handle[R]
to_s[R]

Public Class Methods

available() click to toggle source
# File lib/dex/ui/glyph.rb, line 44
def self.available
  MAP.keys
end
lookup(name) click to toggle source
# File lib/dex/ui/glyph.rb, line 38
def self.lookup(name)
  MAP.fetch(name.to_s)
rescue KeyError
  raise InvalidGlyphHandle, name
end
new(handle, codepoint, color) click to toggle source
# File lib/dex/ui/glyph.rb, line 9
def initialize(handle, codepoint, color)
  @handle    = handle
  @codepoint = codepoint
  @color     = color
  @char      = [codepoint].pack('U')
  @to_s      = color.code + char + Color::RESET.code
  @fmt       = "{{#{color.name}:#{char}}}"

  MAP[handle] = self
end