Sha256: 67c55b03680f3aa563b0b4ce319a933c8ceb7b74e1107eab2c60b42dc4f94146
Contents?: true
Size: 557 Bytes
Versions: 10
Compression:
Stored size: 557 Bytes
Contents
class Usher module Interface class Email def initialize(&blk) @routes = Usher.new(:delimiters => ['@', '-', '.'], :valid_regex => '[\+a-zA-Z0-9]+') instance_eval(&blk) if blk end def for(path, &block) @routes.add_route(path).to(block) end def reset! @routes.reset! end def act(email) response = @routes.recognize(email, email) if response.path response.path.route.destination.call(response.params_as_hash) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems