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.
268 269 270 |
# File 'lib/belt/route_dsl.rb', line 268 def dsl @dsl end |
Instance Method Details
#draw ⇒ Object
274 275 276 277 |
# File 'lib/belt/route_dsl.rb', line 274 def draw(&) instance_eval(&) if block_given? @dsl end |
#namespace(name, options = {}) ⇒ Object
279 280 281 282 283 |
# File 'lib/belt/route_dsl.rb', line 279 def namespace(name, = {}, &) gateway = Belt::ApiGateway.new(name, ) RouteBuilder.new(gateway).instance_eval(&) if block_given? @dsl.api_gateways << gateway end |