Module: NattyUI::Glyph
- Defined in:
- lib/natty-ui/glyph.rb
Overview
Helper class to select glyph types.
Class Attribute Summary collapse
-
.default ⇒ Symbol
writeonly
Define glyph type used by default.
-
.names ⇒ Array<Symbol>
readonly
Defined glyph type names.
Class Method Summary collapse
-
.[](name) ⇒ String
Glyph definition.
Class Attribute Details
.default=(value) ⇒ Symbol (writeonly)
Define glyph type used by default.
13 14 15 |
# File 'lib/natty-ui/glyph.rb', line 13 def self.default=(value) @default = self[value.nil? || value == :default ? :point : value] end |
.names ⇒ Array<Symbol> (readonly)
Defined glyph type names.
22 |
# File 'lib/natty-ui/glyph.rb', line 22 def self.names = @all.keys |
Class Method Details
.[](name) ⇒ String
Returns glyph definition.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/natty-ui/glyph.rb', line 28 def self.[](name) return @default if name == :default Text.embellish( if name.is_a?(Symbol) @all[name] or raise(ArgumentError, "invalid glyph type - #{name}") else name.to_s end ) end |