class ActiveMessaging::Destination

Constants

DEFAULT_PUBLISH_HEADERS

Attributes

broker_name[RW]
name[RW]
publish_headers[RW]
value[RW]
wildcard[RW]

Public Class Methods

new(name, value, publish_headers, broker_name) click to toggle source
# 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

Public Instance Methods

to_s() click to toggle source
# File lib/activemessaging/gateway.rb, line 416
def to_s
  "<destination: #{broker_name} :#{name}=>'#{value}'>"
end

Private Instance Methods

wildcard_match_exp_for(destination) click to toggle source
# File lib/activemessaging/gateway.rb, line 422
def wildcard_match_exp_for(destination)
  exp = destination.to_s.gsub(/[.]/, '\.').gsub(/[*]/, '[^.*]+').gsub(/([>].*$)/, '.*') + '$'
  Regexp.new(exp)
end