Module: CachedRoutes::RouteSet
- Defined in:
- lib/cached_routes/route_set.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/cached_routes/route_set.rb', line 4 def self.included(base) base.alias_method_chain :draw, :caching end |
Instance Method Details
#draw_with_caching(*args, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cached_routes/route_set.rb', line 8 def draw_with_caching(*args, &block) marshaller = Marshaller.new if marshaller.can_unmarshal_routes? marshaller.unmarshal_routes(self.set.routes) else routes_before = self.set.routes.clone draw_without_caching(*args, &block) marshaller.marshal_routes(self.set.routes - routes_before) end end |