class NebulousStomp::Target
Represents a single Target
. Read only.
NebulousStomp.add_target
returns a Target
, or you can retreive one from the config using NebulousStomp.get_target
.
Constants
- VALID_KEYS
Attributes
message_timeout[R]
The message timeout for the queue
name[R]
The identifying name of the queue
receive_queue[R]
The queue that the target listens for requests on
send_queue[R]
The queue that the target sends responses to
Public Class Methods
new(hash)
click to toggle source
Create a target.
Valid keys for the hash:
* :sendQueue * :receiveQeue * :name * :messageTimeout (optional)
# File lib/nebulous_stomp/target.rb, line 36 def initialize(hash) fail ArgumentError, "Argument for Target.new must be a hash" unless hash.is_a? Hash @send_queue = hash[:sendQueue] or fail ArgumentError, "Missing a sendQueue" @receive_queue = hash[:receiveQueue] or fail ArgumentError, "Missing a receiveQueue" @name = hash[:name] or fail ArgumentError, "Missing a name" @message_timeout = hash[:messageTimeout] bad_keys = hash.reject{|k, _| VALID_KEYS.include? k }.keys fail ArgumentError, "Bad keys: #{bad_keys.join ' '}" unless bad_keys.empty? end