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.



276
277
278
# File 'lib/belt/route_dsl.rb', line 276

def initialize
  @dsl = RouteDSL.new
end

Instance Attribute Details

#dslObject (readonly)

Returns the value of attribute dsl.



274
275
276
# File 'lib/belt/route_dsl.rb', line 274

def dsl
  @dsl
end

Instance Method Details

#drawObject



280
281
282
283
# File 'lib/belt/route_dsl.rb', line 280

def draw(&)
  instance_eval(&) if block_given?
  @dsl
end

#namespace(name, options = {}) ⇒ Object



285
286
287
288
289
# File 'lib/belt/route_dsl.rb', line 285

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