Module: OrganizedRoutes
- Defined in:
- lib/organized_routes.rb,
lib/organized_routes/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
- .define(key, &block) ⇒ Object
- .draw(key, context) ⇒ Object
-
.load_routes ⇒ Object
use load so we pick up any changes.
Class Method Details
.define(key, &block) ⇒ Object
9 10 11 |
# File 'lib/organized_routes.rb', line 9 def self.define(key, &block) @routes[key] = block end |
.draw(key, context) ⇒ Object
13 14 15 |
# File 'lib/organized_routes.rb', line 13 def self.draw(key, context) context.instance_exec &@routes[key] || raise("Unknown routes: #{key}") end |
.load_routes ⇒ Object
use load so we pick up any changes
5 6 7 |
# File 'lib/organized_routes.rb', line 5 def self.load_routes Dir["#{Rails.root}/config/routes/**/*.rb"].each {|file| load file} end |