Class: Hoodoo::Services::Discovery::ForRemote

Inherits:
Object
  • Object
show all
Defined in:
lib/hoodoo/services/discovery/results/for_remote.rb

Overview

Describe a “pseudo” resource endpoint location in terms of an interation context and wrapped “real” endpoint instance.

This is a very special case class used for wrapping endpoints in, for example, the inter-resource remote call code in the middleware and in the auto-session code in Hoodoo::Client::Endpoint::AutoSession.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource:, version:, wrapped_endpoint:) ⇒ ForRemote

Create an instance with named parameters as follows:

resource

See #resource.

version

See #version.

wrapped_endpoint

See #wrapped_endpoint.



46
47
48
49
50
51
52
53
# File 'lib/hoodoo/services/discovery/results/for_remote.rb', line 46

def initialize( resource:,
                version:,
                wrapped_endpoint: )

  self.resource         = resource.to_sym
  self.version          = version.to_i
  self.wrapped_endpoint = wrapped_endpoint
end

Instance Attribute Details

#resourceObject

The resource name described, as a Symbol (e.g. :Purchase).



26
27
28
# File 'lib/hoodoo/services/discovery/results/for_remote.rb', line 26

def resource
  @resource
end

#versionObject

Resource endpoint version, as an Integer (e.g. 2).



30
31
32
# File 'lib/hoodoo/services/discovery/results/for_remote.rb', line 30

def version
  @version
end

#wrapped_endpointObject

A wrapped Endpoint class, which will be used for the actual call to the remote resource, after pre/post-processing in the context of #source_interaction (e.g. augmenting session permissions with source-resource-interface-specified additions necessary to call the target remote resource).



38
39
40
# File 'lib/hoodoo/services/discovery/results/for_remote.rb', line 38

def wrapped_endpoint
  @wrapped_endpoint
end