Class: Belt::Application::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/belt/route_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRoutes

Returns a new instance of Routes.



355
356
357
# File 'lib/belt/route_dsl.rb', line 355

def initialize
  @dsl = RouteDSL.new
end

Instance Attribute Details

#dslObject (readonly)

Returns the value of attribute dsl.



353
354
355
# File 'lib/belt/route_dsl.rb', line 353

def dsl
  @dsl
end

Instance Method Details

#drawObject



359
360
361
362
# File 'lib/belt/route_dsl.rb', line 359

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.



365
366
367
368
369
# File 'lib/belt/route_dsl.rb', line 365

def gateway(name, options = {}, &)
  gw = Belt::ApiGateway.new(name, options)
  RouteBuilder.new(gw).instance_eval(&) if block_given?
  @dsl.api_gateways << gw
end