Class: Router
- Inherits:
-
Middleman::Extension
- Object
- Middleman::Extension
- Router
- Defined in:
- lib/middleman-router/extension.rb
Overview
Extension namespace
Class Method Summary collapse
Instance Method Summary collapse
- #after_configuration ⇒ Object
-
#initialize(app, options_hash = {}, &block) ⇒ Router
constructor
A new instance of Router.
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ Router
Returns a new instance of Router.
19 20 21 22 23 24 |
# File 'lib/middleman-router/extension.rb', line 19 def initialize(app, ={}, &block) super @app = app require .routes_location end |
Class Method Details
.add_route(path_name, path_url) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/middleman-router/extension.rb', line 37 def add_route(path_name, path_url) puts "#{path_name} => #{path_url}" define_singleton_method(path_name) do |*args| url(path_url, args.first) end self.expose_to_template << path_name end |
Instance Method Details
#after_configuration ⇒ Object
26 27 28 |
# File 'lib/middleman-router/extension.rb', line 26 def after_configuration # Do something end |