Class: Hoodoo::Services::Middleware::InterResourceRemote

Inherits:
Client::Endpoint show all
Defined in:
lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb

Overview

This is an endpoint which the middleware uses for inter-resource calls over another ‘wrapped’ endpoint. This endpoint manages all the inter-resource preparation and post processing, but calls in to another wrapped endpoint to actually talk to the resource for which the inter-resource call is being made.

Since it wraps another endpoint, instantiation requirements are rather unusual - see #configure_with for details.

Instance Attribute Summary

Attributes inherited from Client::Endpoint

#interaction, #locale, #resource, #session_id, #version

Instance Method Summary collapse

Methods inherited from Client::Endpoint

endpoint_for, #initialize

Constructor Details

This class inherits a constructor from Hoodoo::Client::Endpoint

Instance Method Details

#create(body_hash, query_hash = nil) ⇒ Object

See Hoodoo::Client::Endpoint#create.



87
88
89
90
91
# File 'lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb', line 87

def create( body_hash, query_hash = nil )
  result = preprocess( :create )
  result = @wrapped_endpoint.create( body_hash, query_hash ) if result.nil?
  return postprocess( result )
end

#delete(ident, query_hash = nil) ⇒ Object

See Hoodoo::Client::Endpoint#delete.



103
104
105
106
107
# File 'lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb', line 103

def delete( ident, query_hash = nil )
  result = preprocess( :delete )
  result = @wrapped_endpoint.delete( ident, query_hash ) if result.nil?
  return postprocess( result )
end

#list(query_hash = nil) ⇒ Object

See Hoodoo::Client::Endpoint#list.



71
72
73
74
75
# File 'lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb', line 71

def list( query_hash = nil )
  result = preprocess( :list )
  result = @wrapped_endpoint.list( query_hash ) if result.nil?
  return inject_enumeration_state( postprocess( result ), query_hash )
end

#show(ident, query_hash = nil) ⇒ Object

See Hoodoo::Client::Endpoint#show.



79
80
81
82
83
# File 'lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb', line 79

def show( ident, query_hash = nil )
  result = preprocess( :show )
  result = @wrapped_endpoint.show( ident, query_hash ) if result.nil?
  return postprocess( result )
end

#update(ident, body_hash, query_hash = nil) ⇒ Object

See Hoodoo::Client::Endpoint#update.



95
96
97
98
99
# File 'lib/hoodoo/services/middleware/endpoints/inter_resource_remote.rb', line 95

def update( ident, body_hash, query_hash = nil )
  result = preprocess( :update )
  result = @wrapped_endpoint.update( ident, body_hash, query_hash ) if result.nil?
  return postprocess( result )
end