Class: Belt::Application::Routes
- Inherits:
-
Object
- Object
- Belt::Application::Routes
- Defined in:
- lib/belt/route_dsl.rb
Instance Attribute Summary collapse
-
#dsl ⇒ Object
readonly
Returns the value of attribute dsl.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize ⇒ Routes
constructor
A new instance of Routes.
- #namespace(name, options = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
276 277 278 |
# File 'lib/belt/route_dsl.rb', line 276 def dsl @dsl end |
Instance Method Details
#draw ⇒ Object
282 283 284 285 |
# File 'lib/belt/route_dsl.rb', line 282 def draw(&) instance_eval(&) if block_given? @dsl end |
#namespace(name, options = {}) ⇒ Object
287 288 289 290 291 |
# File 'lib/belt/route_dsl.rb', line 287 def namespace(name, = {}, &) gateway = Belt::ApiGateway.new(name, ) RouteBuilder.new(gateway).instance_eval(&) if block_given? @dsl.api_gateways << gateway end |