Module: MemeMe
- Defined in:
- lib/mememe.rb,
lib/mememe/meme.rb
Defined Under Namespace
Modules: Meme
Class Method Summary collapse
- .fonts ⇒ Object
- .images ⇒ Object
- .install(name, constructor) ⇒ Object
- .installed_memes ⇒ Object
- .memes ⇒ Object
- .require_memes ⇒ Object
Class Method Details
.fonts ⇒ Object
13 14 15 16 17 |
# File 'lib/mememe.rb', line 13 def fonts fonts = {} Dir.glob("#{File.join(File.join(File.dirname(__FILE__)), 'mememe', 'fonts')}/*").each { |f| fonts[File.basename(f).gsub(/\.\w+$/, '').to_sym] = f } fonts end |
.images ⇒ Object
7 8 9 10 11 |
# File 'lib/mememe.rb', line 7 def images images = {} Dir.glob("#{File.join(File.(File.dirname(__FILE__)), 'mememe', 'images')}/*").each { |i| images[File.basename(i).gsub(/\.\w+$/, '').to_sym] = i } images end |
.install(name, constructor) ⇒ Object
25 26 27 28 |
# File 'lib/mememe.rb', line 25 def install(name, constructor) @installed_memes ||= {} @installed_memes[name] = constructor end |
.installed_memes ⇒ Object
30 31 32 |
# File 'lib/mememe.rb', line 30 def installed_memes @installed_memes ||= {} end |
.memes ⇒ Object
19 20 21 22 23 |
# File 'lib/mememe.rb', line 19 def memes memes = {} Dir.glob("#{File.join(File.join(File.dirname(__FILE__)), 'mememe', 'memes')}/*").each { |f| memes[File.basename(f).gsub(/\.\w+$/, '').to_sym] = f } memes end |
.require_memes ⇒ Object
34 35 36 |
# File 'lib/mememe.rb', line 34 def require_memes memes.each_pair { |n, m| require m } end |