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.



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

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.



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

def broker_name
  @broker_name
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#publish_headersObject

Returns the value of attribute publish_headers.



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

def publish_headers
  @publish_headers
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

#wildcardObject

Returns the value of attribute wildcard.



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

def wildcard
  @wildcard
end

Instance Method Details

#to_sObject



416
417
418
# File 'lib/activemessaging/gateway.rb', line 416

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