Class: APIGatewayDSL::DSL::OperationNode
- Inherits:
- BasicObject
- Defined in:
- lib/api_gateway_dsl/dsl/operation_node.rb
Instance Method Summary collapse
- #description(value) ⇒ Object
- #header(name, **options) ⇒ Object
-
#initialize(operation, &block) ⇒ OperationNode
constructor
A new instance of OperationNode.
-
#LAMBDA(lambda_arn, **options, &block) ⇒ Object
rubocop:disable Style/MethodName.
-
#MOCK(status_code, **options) ⇒ Object
rubocop:disable Style/MethodName.
-
#path(name, **options) ⇒ Object
Parameters.
- #query(name, **options) ⇒ Object
-
#RESPONSE(status_code, regexp = nil, &block) ⇒ Object
Responses.
-
#summary(value) ⇒ Object
General.
Constructor Details
#initialize(operation, &block) ⇒ OperationNode
Returns a new instance of OperationNode.
5 6 7 8 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 5 def initialize(operation, &block) @operation = operation instance_eval(&block) if block end |
Instance Method Details
#description(value) ⇒ Object
16 17 18 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 16 def description(value) @operation.description = value end |
#header(name, **options) ⇒ Object
30 31 32 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 30 def header(name, **) @operation.parameters << Parameter::Header.new(name, **) end |
#LAMBDA(lambda_arn, **options, &block) ⇒ Object
rubocop:disable Style/MethodName
50 51 52 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 50 def LAMBDA(lambda_arn, **, &block) # rubocop:disable Style/MethodName @operation.integrations << Integration::Lambda.new(@operation, lambda_arn, **, &block) end |
#MOCK(status_code, **options) ⇒ Object
rubocop:disable Style/MethodName
54 55 56 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 54 def MOCK(status_code, **) # rubocop:disable Style/MethodName @operation.integrations << Integration::Mock.new(@operation, status_code, **) end |
#path(name, **options) ⇒ Object
Parameters
22 23 24 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 22 def path(name, **) @operation.parameters << Parameter::Path.new(name, **) end |
#query(name, **options) ⇒ Object
26 27 28 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 26 def query(name, **) @operation.parameters << Parameter::Query.new(name, **) end |
#RESPONSE(status_code, regexp = nil, &block) ⇒ Object
Responses
60 61 62 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 60 def RESPONSE(status_code, regexp = nil, &block) # rubocop:disable Style/MethodName @operation.responses << Response.new(@operation, status_code, regexp, &block) end |
#summary(value) ⇒ Object
General
12 13 14 |
# File 'lib/api_gateway_dsl/dsl/operation_node.rb', line 12 def summary(value) @operation.summary = value end |