Class: ActiveMessaging::Destination

Inherits:
Object
  • Object
show all
Defined in:
lib/activemessaging/gateway.rb

Constant Summary collapse

DEFAULT_PUBLISH_HEADERS =
{ :persistent=>true }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value, publish_headers, broker_name) ⇒ Destination

Returns a new instance of Destination.



406
407
408
409
410
# File 'lib/activemessaging/gateway.rb', line 406

def initialize(name, value, publish_headers, broker_name)
  @name, @value, @publish_headers, @broker_name = name, value, publish_headers, broker_name
  @publish_headers.reverse_merge! DEFAULT_PUBLISH_HEADERS
  @wildcard = wildcard_match_exp_for(value) if (value =~ /\*/)
end

Instance Attribute Details

#broker_nameObject

Returns the value of attribute broker_name.



404
405
406
# File 'lib/activemessaging/gateway.rb', line 404

def broker_name
  @broker_name
end

#nameObject

Returns the value of attribute name.



404
405
406
# File 'lib/activemessaging/gateway.rb', line 404

def name
  @name
end

#publish_headersObject

Returns the value of attribute publish_headers.



404
405
406
# File 'lib/activemessaging/gateway.rb', line 404

def publish_headers
  @publish_headers
end

#valueObject

Returns the value of attribute value.



404
405
406
# File 'lib/activemessaging/gateway.rb', line 404

def value
  @value
end

#wildcardObject

Returns the value of attribute wildcard.



404
405
406
# File 'lib/activemessaging/gateway.rb', line 404

def wildcard
  @wildcard
end

Instance Method Details

#to_sObject



412
413
414
# File 'lib/activemessaging/gateway.rb', line 412

def to_s
  "<destination: #{broker_name} :#{name}=>'#{value}'>"
end