Class: Belt::RouteDSL
- Inherits:
-
Object
- Object
- Belt::RouteDSL
- Defined in:
- lib/belt/route_dsl.rb
Overview
Minimal RouteDSL for legacy api_gateway style
Instance Attribute Summary collapse
-
#api_gateways ⇒ Object
readonly
Returns the value of attribute api_gateways.
Class Method Summary collapse
Instance Method Summary collapse
- #api_gateway(name, options = {}) ⇒ Object
-
#initialize ⇒ RouteDSL
constructor
A new instance of RouteDSL.
Constructor Details
#initialize ⇒ RouteDSL
Returns a new instance of RouteDSL.
505 506 507 |
# File 'lib/belt/route_dsl.rb', line 505 def initialize @api_gateways = [] end |
Instance Attribute Details
#api_gateways ⇒ Object (readonly)
Returns the value of attribute api_gateways.
503 504 505 |
# File 'lib/belt/route_dsl.rb', line 503 def api_gateways @api_gateways end |
Class Method Details
.load_from_file(filename) ⇒ Object
515 516 517 518 519 |
# File 'lib/belt/route_dsl.rb', line 515 def self.load_from_file(filename) dsl = new dsl.instance_eval(File.read(filename), filename) dsl end |
Instance Method Details
#api_gateway(name, options = {}) ⇒ Object
509 510 511 512 513 |
# File 'lib/belt/route_dsl.rb', line 509 def api_gateway(name, = {}, &) gateway = Belt::ApiGateway.new(name, ) gateway.instance_eval(&) if block_given? @api_gateways << gateway end |