Class: Belt::RouteDSL

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

Overview

Minimal RouteDSL for legacy api_gateway style

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRouteDSL

Returns a new instance of RouteDSL.



615
616
617
# File 'lib/belt/route_dsl.rb', line 615

def initialize
  @api_gateways = []
end

Instance Attribute Details

#api_gatewaysObject (readonly)

Returns the value of attribute api_gateways.



613
614
615
# File 'lib/belt/route_dsl.rb', line 613

def api_gateways
  @api_gateways
end

Class Method Details

.load_from_file(filename) ⇒ Object



625
626
627
628
629
# File 'lib/belt/route_dsl.rb', line 625

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



619
620
621
622
623
# File 'lib/belt/route_dsl.rb', line 619

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