In Files

Methods

Class/Module Index [+]

Quicksearch

Meme::GENERATORS

Public Class Methods

match(name) click to toggle source

Looks up generator name

# File lib/meme.rb, line 104
def GENERATORS.match(name)
  # TODO  meme Y U NO DEMETAPHONE?
  return self[name] if has_key? name
  matcher = Regexp.new(name, Regexp::IGNORECASE)
  _, generator = find { |k,v| matcher =~ k || v.grep(matcher).any? }
  generator || self[name] # raises the error if generator is nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.