Sha256: c2dff9342cbdc2860b667568b9ed743f6c5d1c3c32b0442b698764494d4b7fe0
Contents?: true
Size: 751 Bytes
Versions: 14
Compression:
Stored size: 751 Bytes
Contents
# -*- encoding: utf-8 -*- # Adds the a set of headers to all frames generated on the scope. class OnStomp::Components::Scopes::HeaderScope include OnStomp::Interfaces::FrameMethods attr_reader :headers, :client, :connection def initialize headers, client @headers = headers @client = client @connection = client.connection end # Wraps {OnStomp::Client#transmit}, applying the set of {#headers} to # all frames befor they are delivered to the broker. # @param [OnStomp::Components::Frame] frame # @param [{Symbol => Proc}] cbs # @return [OnStomp::Components::Frame] # @see OnStomp::Client#transmit def transmit frame, cbs={} frame.headers.reverse_merge!(headers) client.transmit frame, cbs end end
Version data entries
14 entries across 14 versions & 1 rubygems