Class: AceMQ::AMQP::Patterns::Step

Inherits:
Struct
  • Object
show all
Defined in:
lib/acemq/amqp/patterns/routing_slip.rb

Overview

One stop on a routing slip.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#completed_at ⇒ Object

Returns the value of attribute completed_at

Returns:

  • (Object) —

    the current value of completed_at



45
46
47
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 45

def completed_at
  @completed_at
end

#exchange ⇒ Object

Returns the value of attribute exchange

Returns:

  • (Object) —

    the current value of exchange



45
46
47
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 45

def exchange
  @exchange
end

#name ⇒ Object

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



45
46
47
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 45

def name
  @name
end

#routing_key ⇒ Object

Returns the value of attribute routing_key

Returns:

  • (Object) —

    the current value of routing_key



45
46
47
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 45

def routing_key
  @routing_key
end

Class Method Details

.from_wire(raw) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



57
58
59
60
61
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 57

def self.from_wire(raw)
  raw = raw.to_h { |key, value| [key.to_s, value] }
  new(exchange: raw["exchange"].to_s, routing_key: raw["routingKey"].to_s,
      name: raw["name"], completed_at: raw["completedAt"])
end

Instance Method Details

#to_s ⇒ Object



46
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 46

def to_s = name.to_s.empty? ? "#{exchange}/#{routing_key}" : name

#to_wire ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
52
53
54
# File 'lib/acemq/amqp/patterns/routing_slip.rb', line 49

def to_wire
  wire = { "exchange" => exchange.to_s, "routingKey" => routing_key.to_s }
  wire["name"] = name unless name.to_s.empty?
  wire["completedAt"] = completed_at unless completed_at.to_s.empty?
  wire
end