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
-
#gateway(name, options = {}) ⇒ Object
(also: #namespace)
Primary DSL keyword: defines an API Gateway with a default Lambda function.
-
#initialize ⇒ Routes
constructor
A new instance of Routes.
Constructor Details
Instance Attribute Details
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
292 293 294 |
# File 'lib/belt/route_dsl.rb', line 292 def dsl @dsl end |
Instance Method Details
#draw ⇒ Object
298 299 300 301 |
# File 'lib/belt/route_dsl.rb', line 298 def draw(&) instance_eval(&) if block_given? @dsl end |
#gateway(name, options = {}) ⇒ Object Also known as: namespace
Primary DSL keyword: defines an API Gateway with a default Lambda function.
304 305 306 307 308 |
# File 'lib/belt/route_dsl.rb', line 304 def gateway(name, = {}, &) gw = Belt::ApiGateway.new(name, ) RouteBuilder.new(gw).instance_eval(&) if block_given? @dsl.api_gateways << gw end |