Class: Icomoon2Sass::Font
- Inherits:
-
Object
- Object
- Icomoon2Sass::Font
- Defined in:
- lib/icomoon2sass/font.rb
Instance Attribute Summary collapse
-
#font_family ⇒ Object
readonly
Returns the value of attribute font_family.
-
#icons ⇒ Object
readonly
Returns the value of attribute icons.
Instance Method Summary collapse
-
#initialize(metadata) ⇒ Font
constructor
A new instance of Font.
Constructor Details
#initialize(metadata) ⇒ Font
Returns a new instance of Font.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/icomoon2sass/font.rb', line 6 def initialize() @icons = {} json = JSON.parse() @font_family = json['preferences']['fontPref']['metadata']['fontFamily'] json['icons'].each do |icon| @icons[icon['properties']['name']] = { character: [icon['properties']['code']].pack('U'), codepoint: '\%0x' % icon['properties']['code'].ord } end end |
Instance Attribute Details
#font_family ⇒ Object (readonly)
Returns the value of attribute font_family.
4 5 6 |
# File 'lib/icomoon2sass/font.rb', line 4 def font_family @font_family end |
#icons ⇒ Object (readonly)
Returns the value of attribute icons.
4 5 6 |
# File 'lib/icomoon2sass/font.rb', line 4 def icons @icons end |