Class: WsdlMapper::Runtime::Api

Inherits:
Object
  • Object
show all
Includes:
SimplerInspect
Defined in:
lib/wsdl_mapper/runtime/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SimplerInspect

#inspect

Constructor Details

#initialize(backend) ⇒ Api

Returns a new instance of Api.

Parameters:



15
16
17
18
# File 'lib/wsdl_mapper/runtime/api.rb', line 15

def initialize(backend)
  @_backend = backend
  @_services = []
end

Instance Attribute Details

#_servicesArray<WsdlMapper::Runtime::Service>

Returns All services contained in this API.

Returns:



11
12
13
# File 'lib/wsdl_mapper/runtime/api.rb', line 11

def _services
  @_services
end

Instance Method Details

#_call(operation, *args) ⇒ Object

Executes a request using the configured backend.

Parameters:

Returns:

  • (Object)

    Response



24
25
26
# File 'lib/wsdl_mapper/runtime/api.rb', line 24

def _call(operation, *args)
  @_backend.dispatch operation, *args
end

#_call_async(operation, args_promise) ⇒ Concurrent::Promise

Executes a request async using the configured backend.

Parameters:

Returns:

  • (Concurrent::Promise)

    Promise for the response



32
33
34
# File 'lib/wsdl_mapper/runtime/api.rb', line 32

def _call_async(operation, args_promise)
  @_backend.dispatch_async operation, args_promise
end

#_load_requiresObject

Force preloading of requires for all contained services



37
38
39
# File 'lib/wsdl_mapper/runtime/api.rb', line 37

def _load_requires
  @_services.each(&:_load_requires)
end