Class: GameIcons::Finder
- Inherits:
-
Object
- Object
- GameIcons::Finder
- Defined in:
- lib/game_icons/finder.rb
Instance Method Summary collapse
-
#find(icon) ⇒ Object
Find the icon, possibly without the extension.
Instance Method Details
#find(icon) ⇒ Object
Find the icon, possibly without the extension. Raises an error if the icon could not be found.
11 12 13 14 15 16 17 |
# File 'lib/game_icons/finder.rb', line 11 def find(icon) str = icon.to_s.downcase file = DB.files[str] || DB.files[str.sub(/\.svg$/,'')] || not_found(str, icon) Icon.new(file) end |