Class: Usher::Interface::MerbInterface
- Inherits:
-
Object
- Object
- Usher::Interface::MerbInterface
- Defined in:
- lib/usher/interface/merb_interface.rb
Constant Summary collapse
Class Attribute Summary collapse
-
.root_behavior ⇒ Object
Returns the value of attribute root_behavior.
Class Method Summary collapse
- .compile ⇒ Object
- .named_routes ⇒ Object
- .prepare(first = [], last = [], &block) ⇒ Object
- .route_for(request) ⇒ Object
- .routes ⇒ Object
Instance Method Summary collapse
-
#load_into_merb! ⇒ Object
class BootLoader < ::Merb::BootLoader end.
Class Attribute Details
.root_behavior ⇒ Object
Returns the value of attribute root_behavior.
13 14 15 |
# File 'lib/usher/interface/merb_interface.rb', line 13 def root_behavior @root_behavior end |
Class Method Details
.compile ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/usher/interface/merb_interface.rb', line 25 def compile routes.each do |r| r.segments end #puts r.inspect; UsherRoutes.add_route(r) } #routes.each {|r| } end |
.named_routes ⇒ Object
34 35 36 |
# File 'lib/usher/interface/merb_interface.rb', line 34 def named_routes UsherRoutes.named_routes end |
.prepare(first = [], last = [], &block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/usher/interface/merb_interface.rb', line 17 def prepare(first = [], last = [], &block) @routes = [] root_behavior._with_proxy(&block) @routes = first + @routes + last compile self end |
.route_for(request) ⇒ Object
42 43 44 45 46 |
# File 'lib/usher/interface/merb_interface.rb', line 42 def route_for(request) p request p UsherRoutes.tree UsherRoutes.recognize(request) end |
.routes ⇒ Object
38 39 40 |
# File 'lib/usher/interface/merb_interface.rb', line 38 def routes UsherRoutes.routes end |
Instance Method Details
#load_into_merb! ⇒ Object
class BootLoader < ::Merb::BootLoader end
53 54 55 56 57 |
# File 'lib/usher/interface/merb_interface.rb', line 53 def load_into_merb! ::Merb.send(:remove_const, "Router") ::Merb.const_set("Router", Usher::Interface::MerbInterface) #::Merb::BootLoader.const_set("Router", Usher::Interface::Merb::BootLoader) end |