Class: Track::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/track/routes.rb

Constant Summary collapse

@@route_map =
RouteMap.new

Class Method Summary collapse

Class Method Details

.define(&block) ⇒ Object



15
16
17
# File 'lib/track/routes.rb', line 15

def define(&block)
  @@route_map.instance_eval &block
end

.find(method, path) ⇒ Object



19
20
21
# File 'lib/track/routes.rb', line 19

def find(method, path)
  @@route_map.scan(path, method.downcase.to_sym)
end

.load!(route_file) ⇒ Object



11
12
13
# File 'lib/track/routes.rb', line 11

def load!(route_file)
  require route_file
end