Class: Pheromone::Messaging::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/pheromone/messaging/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic:, blob:, metadata: {}, options: {}) ⇒ Message

Returns a new instance of Message.



7
8
9
10
11
12
# File 'lib/pheromone/messaging/message.rb', line 7

def initialize(topic:, blob:, metadata: {}, options: {})
  @topic = topic
  @blob = blob
  @options = options || {}
   =  || {}
end

Instance Attribute Details

#blobObject (readonly)

Returns the value of attribute blob.



14
15
16
# File 'lib/pheromone/messaging/message.rb', line 14

def blob
  @blob
end

#metadataObject (readonly)

Returns the value of attribute metadata.



14
15
16
# File 'lib/pheromone/messaging/message.rb', line 14

def 
  
end

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'lib/pheromone/messaging/message.rb', line 14

def options
  @options
end

#topicObject (readonly)

Returns the value of attribute topic.



14
15
16
# File 'lib/pheromone/messaging/message.rb', line 14

def topic
  @topic
end

Instance Method Details

#send!Object



16
17
18
19
20
21
22
# File 'lib/pheromone/messaging/message.rb', line 16

def send!
  ::WaterDrop::Message.new(
    topic,
    MessageFormatter.new(full_message).format,
    options
  ).send!
end