Class ActionWebService::API::Base
In: lib/action_web_service/api.rb
Parent: Object

A web service API class specifies the methods that will be available for invocation for an API. It also contains metadata such as the method type signature hints.

It is not intended to be instantiated.

It is attached to web service implementation classes like ActionWebService::Base and ActionController::Base derivatives by using container.web_service_api, where container is an ActionController::Base or a ActionWebService::Base.

See ActionWebService::Container::Direct::ClassMethods for an example of use.

Methods

Included Modules

ActionWebService::SignatureTypes

Public Class methods

API methods have a name, which must be the Ruby method name to use when performing the invocation on the web service object.

The signatures for the method input parameters and return value can by specified in options.

A signature is an array of one or more parameter specifiers. A parameter specifier can be one of the following:

  • A symbol or string of representing one of the Action Web Service base types. See ActionWebService::SignatureTypes for a canonical list of the base types.
  • The Class object of the parameter type
  • A single-element Array containing one of the two preceding items. This will cause Action Web Service to treat the parameter at that position as an array containing only values of the given type.
  • A Hash containing as key the name of the parameter, and as value one of the three preceding items

If no method input parameter or method return value signatures are given, the method is assumed to take no parameters and/or return no values of interest, and any values that are received by the server will be discarded and ignored.

Valid options:

:expects
Signature for the method input parameters
:returns
Signature for the method return value
:expects_and_returns
Signature for both input parameters and return value

The Method instance for the given API method name, if any

The corresponding service method name for the given public method name

A Hash containing all service methods on this API, and their associated metadata.

The Method instance for the default API method, if any

Whether the given method name is a service method on this API

Whether the given public method name has a corresponding service method on this API

The Method instance for the given public API method name, if any

The corresponding public method name for the given service method name

[Validate]