Class: Jsapi::DSL::Callback

Inherits:
Base
  • Object
show all
Defined in:
lib/jsapi/dsl/callback.rb

Overview

Used to specify an OpenAPI callback object.

Instance Method Summary collapse

Methods inherited from Base

#import, #import_relative, #initialize, #respond_to_missing?

Constructor Details

This class inherits a constructor from Jsapi::DSL::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Jsapi::DSL::Base

Instance Method Details

#operation(expression, **keywords, &block) ⇒ Object

Adds a callback operation.

operation '{$request.query.foo}' do
  parameter 'bar', type: 'string'
end


13
14
15
16
17
18
# File 'lib/jsapi/dsl/callback.rb', line 13

def operation(expression, **keywords, &block)
  define('operation', expression.inspect) do
    operation_model = @meta_model.add_operation(expression, keywords)
    Operation.new(operation_model, &block) if block
  end
end