Class: Hoodoo::Services::Discovery::ForAMQP
- Inherits:
-
Object
- Object
- Hoodoo::Services::Discovery::ForAMQP
- Defined in:
- lib/hoodoo/services/discovery/results/for_amqp.rb
Overview
Describe a resource endpoint location in a way that allows it to be contacted over AMQP (e.g. via Alchemy).
Instance Attribute Summary collapse
-
#resource ⇒ Object
The resource name described, as a Symbol (e.g.
:Purchase
). -
#routing_path ⇒ Object
readonly
Path at which the resource is expected to be found on the queue (routing via Topic Exchange and Alchemy Flux’s translations of paths to keys).
-
#version ⇒ Object
Resource endpoint version, as an Integer (e.g. 2).
Instance Method Summary collapse
-
#initialize(resource:, version:) ⇒ ForAMQP
constructor
Create an instance with named parameters as follows:.
Constructor Details
#initialize(resource:, version:) ⇒ ForAMQP
Create an instance with named parameters as follows:
resource
-
See #resource.
version
-
See #version.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/hoodoo/services/discovery/results/for_amqp.rb', line 39 def initialize( resource:, version: ) @resource = resource.to_sym @version = version.to_i @routing_path = Hoodoo::Services::Middleware.de_facto_path_for( resource, version ) end |
Instance Attribute Details
#resource ⇒ Object
The resource name described, as a Symbol (e.g. :Purchase
).
22 23 24 |
# File 'lib/hoodoo/services/discovery/results/for_amqp.rb', line 22 def resource @resource end |
#routing_path ⇒ Object (readonly)
Path at which the resource is expected to be found on the queue (routing via Topic Exchange and Alchemy Flux’s translations of paths to keys).
32 33 34 |
# File 'lib/hoodoo/services/discovery/results/for_amqp.rb', line 32 def routing_path @routing_path end |
#version ⇒ Object
Resource endpoint version, as an Integer (e.g. 2).
26 27 28 |
# File 'lib/hoodoo/services/discovery/results/for_amqp.rb', line 26 def version @version end |