Class: Evil::Client::Container::Operation
- Inherits:
-
Evil::Client::Container
- Object
- Evil::Client::Container
- Evil::Client::Container::Operation
- Defined in:
- lib/evil/client/container/operation.rb
Overview
Contains operation schema and settings along with DSL method [#call] to sends a request to API and handle the response.
Instance Attribute Summary
Attributes inherited from Evil::Client::Container
Instance Method Summary collapse
-
#call ⇒ Array
Executes the operation and returns rack-compatible response.
Methods inherited from Evil::Client::Container
#client, #logger, #logger=, #name, #options, #to_s
Instance Method Details
#call ⇒ Array
Executes the operation and returns rack-compatible response
rubocop: disable Metrics/AbcSize
12 13 14 15 16 17 18 19 20 |
# File 'lib/evil/client/container/operation.rb', line 12 def call request = Resolver::Request.call(schema, settings) middleware = Resolver::Middleware.call(schema, settings) connection = schema.client.connection stack = middleware.inject(connection) { |app, layer| layer.new app } response = stack.call request Resolver::Response.call schema, settings, response end |