Class: ApiTaster::RouteCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/api_taster/route_collector.rb

Class Method Summary collapse

Class Method Details

.collect(path) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/api_taster/route_collector.rb', line 6

def self.collect(path)
  self.routes = []
  Dir["#{path}/**/*.rb"].each { |file| load(file) }

  Route.mappings = Proc.new do
    RouteCollector.routes.each { |route| instance_eval(&route) }
  end
end