Class: Proximity::Routes
- Inherits:
-
Object
- Object
- Proximity::Routes
- Defined in:
- lib/proximity/routes.rb
Instance Attribute Summary collapse
-
#proxies ⇒ Object
readonly
Returns the value of attribute proxies.
Instance Method Summary collapse
Instance Attribute Details
#proxies ⇒ Object (readonly)
Returns the value of attribute proxies.
4 5 6 |
# File 'lib/proximity/routes.rb', line 4 def proxies @proxies end |
Instance Method Details
#[](index) ⇒ Object
6 7 8 |
# File 'lib/proximity/routes.rb', line 6 def [](index) routes[index] end |
#add_proxy(router, source, target, format) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/proximity/routes.rb', line 10 def add_proxy(router, source, target, format) proxy = Proxy.new(router) proxy.source = source proxy.target = target proxy.format = format route = add_route(app, proxy.pattern, {}, {}) route.extend(proxy_attr_module) proxy.tap { |p| route.proxy = p } end |
#proxy_attr_module ⇒ Object
21 22 23 |
# File 'lib/proximity/routes.rb', line 21 def proxy_attr_module @proxy_attr_module ||= Module.new { attr_accessor :proxy } end |