Class: APIGatewayDSL::DSL::ResponseNode
- Inherits:
- BasicObject
- Defined in:
- lib/api_gateway_dsl/dsl/response_node.rb
Instance Method Summary collapse
-
#body(**options) ⇒ Object
Templates.
-
#header(name, source = nil) ⇒ Object
Header Mappings.
-
#initialize(response, &block) ⇒ ResponseNode
constructor
A new instance of ResponseNode.
Constructor Details
#initialize(response, &block) ⇒ ResponseNode
Returns a new instance of ResponseNode.
5 6 7 8 |
# File 'lib/api_gateway_dsl/dsl/response_node.rb', line 5 def initialize(response, &block) @response = response instance_eval(&block) if block end |
Instance Method Details
#body(**options) ⇒ Object
Templates
18 19 20 |
# File 'lib/api_gateway_dsl/dsl/response_node.rb', line 18 def body(**) @response.templates << Template.new(@response.context, **) end |
#header(name, source = nil) ⇒ Object
Header Mappings
12 13 14 |
# File 'lib/api_gateway_dsl/dsl/response_node.rb', line 12 def header(name, source = nil) @response.mappings << Mapping.new('method', 'response', 'header', name, source) end |