Class: MultipleMan::RoutingKey
- Inherits:
-
Object
- Object
- MultipleMan::RoutingKey
- Defined in:
- lib/multiple_man/routing_key.rb
Constant Summary collapse
- ALLOWED_OPERATIONS =
[:create, :update, :destroy, :seed, :"#"]
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#operation ⇒ Object
Returns the value of attribute operation.
Instance Method Summary collapse
-
#initialize(klass, operation = :"#") ⇒ RoutingKey
constructor
A new instance of RoutingKey.
- #to_s ⇒ Object
Constructor Details
#initialize(klass, operation = :"#") ⇒ RoutingKey
Returns a new instance of RoutingKey.
5 6 7 8 |
# File 'lib/multiple_man/routing_key.rb', line 5 def initialize(klass, operation = :"#") self.klass = klass self.operation = operation end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
19 20 21 |
# File 'lib/multiple_man/routing_key.rb', line 19 def klass @klass end |
#operation ⇒ Object
Returns the value of attribute operation.
18 19 20 |
# File 'lib/multiple_man/routing_key.rb', line 18 def operation @operation end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 |
# 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 |