Sha256: 14980a1568ba0875e3457f859f6ff31bdbc6ff2a2af551cbceaa18865cf6ed8b
Contents?: true
Size: 577 Bytes
Versions: 16
Compression:
Stored size: 577 Bytes
Contents
# frozen_string_literal: true class HelloPublisher include Cloudenvoy::Publisher cloudenvoy_options topic: 'hello-msgs' # # Set message metadata (attributes) # # @param [String] msg The message to publish # # @return [Hash] The message metadata # def metadata(msg) { kind: msg.start_with?('Hello') ? 'hello' : 'regular' } end # # Format the payload. # # @param [String] msg The message to publish # # @return [Hash] The formatted message # def payload(msg) { type: 'message', content: msg } end end
Version data entries
16 entries across 11 versions & 1 rubygems