Class: Primer::RouteSet
- Inherits:
-
Object
- Object
- Primer::RouteSet
- Defined in:
- lib/primer/route_set.rb
Instance Method Summary collapse
- #evaluate(path) ⇒ Object
- #get(path, &block) ⇒ Object
-
#initialize(&routes) ⇒ RouteSet
constructor
A new instance of RouteSet.
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 |