class MultipleMan::RoutingKey

Constants

ALLOWED_OPERATIONS

Attributes

klass[RW]
operation[R]

Public Class Methods

new(klass, operation = :" click to toggle source
# File lib/multiple_man/routing_key.rb, line 5
def initialize(klass, operation = :"#")
  self.klass = klass
  self.operation = operation
end

Public Instance Methods

operation=(value) click to toggle source
# File lib/multiple_man/routing_key.rb, line 21
def operation=(value)
  raise "Operation #{value} is not recognized" unless ALLOWED_OPERATIONS.include?(value.to_sym)
  @operation = value
end
to_s() click to toggle source
# File lib/multiple_man/routing_key.rb, line 10
def to_s
  if operation.to_sym == :seed
    "#{topic_name}.#{operation}.#{klass}"
  else
    "#{topic_name}.#{klass}.#{operation}"
  end
end

Private Instance Methods

topic_name() click to toggle source
# File lib/multiple_man/routing_key.rb, line 27
def topic_name
  MultipleMan.configuration.topic_name
end