Class: GameIcons::DB
- Inherits:
-
Object
- Object
- GameIcons::DB
- Defined in:
- lib/game_icons/db.rb
Constant Summary collapse
- @@icons =
Class-level hash of icon names to their absolute path in this gem
Hash.new
Class Method Summary collapse
Class Method Details
.files ⇒ Object
21 22 23 24 |
# File 'lib/game_icons/db.rb', line 21 def files init @@icons end |
.init ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/game_icons/db.rb', line 7 def init return unless @@icons.empty? resources = File.('../../resources', File.dirname(__FILE__)) Dir.glob("#{resources}/**/*.svg").each do |svg| name = File.basename(svg,'.svg').downcase @@icons[name] = svg #chop off .svg end end |
.names ⇒ Object
16 17 18 19 |
# File 'lib/game_icons/db.rb', line 16 def names init @@icons.keys end |