Class: Entypo::Charmap

Inherits:
Object
  • Object
show all
Defined in:
lib/entypo/charmap.rb

Overview

The Charmap simply “parses” a CSS file which must conform to the following format:

.icon$NAME$:before { content: …} /* $codepoint$ */

Defined Under Namespace

Classes: Icon

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Charmap

Returns a new instance of Charmap.



32
33
34
# File 'lib/entypo/charmap.rb', line 32

def initialize(path)
  @icons = load(path)
end

Instance Attribute Details

#iconsObject (readonly)

Access the icons array.



30
31
32
# File 'lib/entypo/charmap.rb', line 30

def icons
  @icons
end

Class Method Details

.iconsObject

Public: Returns Array of icons.

Returns Array of Icon instances.



25
26
27
# File 'lib/entypo/charmap.rb', line 25

def self.icons
  instance.icons
end

.instanceObject

Public: Access the shared instance based on our default entypo.scss file.

Returns Charmap instance.



18
19
20
# File 'lib/entypo/charmap.rb', line 18

def self.instance
  @@instance ||= self.new File.expand_path('../../../app/assets/stylesheets/entypo.scss.erb', __FILE__)
end