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(options={},&block)
  
  options = default_options = {
    strategy_key:    "base",
    class_name:   "Urifetch::Strategy::Base"
  }.merge(options)
  
  @routes = Hash.new(options)
  
  instance_eval(&block) if block_given?
  
  @routes[/(?<base>(?<match_id>.*))/i] = @routes[""]
end