Class: Primer::RouteSet

Inherits:
Object
  • Object
show all
Defined in:
lib/primer/route_set.rb

Instance Method Summary collapse

Constructor Details

#initialize(&routes) ⇒ RouteSet

Returns a new instance of RouteSet.



5
6
7
8
# File 'lib/primer/route_set.rb', line 5

def initialize(&routes)
  @app = Class.new(Router)
  instance_eval(&routes) if block_given?
end

Instance Method Details

#evaluate(path) ⇒ Object



14
15
16
# File 'lib/primer/route_set.rb', line 14

def evaluate(path)
  @app.new(path).evaluate
end

#get(path, &block) ⇒ Object



10
11
12
# File 'lib/primer/route_set.rb', line 10

def get(path, &block)
  @app.get(path, &block)
end