Method: Urifetch::Router#initialize
- Defined in:
- lib/urifetch/router.rb
#initialize(options = {}, &block) ⇒ Router
Returns a new instance of Router.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/urifetch/router.rb', line 7 def initialize(={},&block) = = { strategy_key: "base", class_name: "Urifetch::Strategy::Base" }.merge() @routes = Hash.new() instance_eval(&block) if block_given? @routes[/(?<base>(?<match_id>.*))/i] = @routes[""] end |