class Hoodoo::Services::Discovery::ForLocal
Describe a resource endpoint location in a way that allows it to be method-called from the service middleware directly.
This is a very special case class used for the inter-resource local call code in Hoodoo::Services::Middleware
. It really exists only for semantic purposes; the middleware calls via Hoodoo::Client::Endpoint
subclass Hoodoo::Sevices::Middleware::InterResourceLocal; and the Endpoint subclass family are supposed to use result classes from the Hoodoo::Services::Discovery
engine when they configure instances.
This isn’t actually enforced anywhere, but conceptually it’s cleanest to follow the same pattern.
Attributes
The base path of this resource and version - for example, “/v1/products” or “/v2/members”. String.
The de facto routing equivalent of base_path
. This is not a custom path based on the interface’s declared endpoint; it is derived directlyf rom resource or version - for example, “/1/Product” or “/2/Member”. String.
As routing_regexp
, but matches de_facto_base_path
.
The Hoodoo::Services::Implementation
subclass instance which implements the interface described by interface_class
.
The Hoodoo::Services::Interface
subclass class describing the resource interface.
The resource name described, as a Symbol (e.g. :Purchase
).
A regular expression which matches the base_path
and any identifier data, allowing inbound URI-based requests to be routed to this endpoint. Regexp instance.
Resource endpoint version, as an Integer (e.g. 2).
Public Class Methods
Create an instance with named parameters as follows:
resource
-
See
resource
. version
-
See
version
. base_path
-
See
base_path
. routing_regexp
-
See
routing_regexp
. de_facto_base_path
-
See
de_facto_base_path
. de_facto_routing_regexp
interface_class
-
See
interface_class
. implementation_instance
# File lib/hoodoo/services/discovery/results/for_local.rb, line 81 def initialize( resource:, version:, base_path:, routing_regexp:, de_facto_base_path:, de_facto_routing_regexp:, interface_class:, implementation_instance: ) self.resource = resource.to_sym self.version = version.to_i self.base_path = base_path self.routing_regexp = routing_regexp self.de_facto_base_path = de_facto_base_path self.de_facto_routing_regexp = de_facto_routing_regexp self.interface_class = interface_class self.implementation_instance = implementation_instance end