Class: EnvelopeWrapperBase

Inherits:
Object
  • Object
show all
Defined in:
lib/rookout/com_ws/envelope_wrapper.rb

Direct Known Subclasses

EnvelopeWrapper, Variant2EnvelopeWrapper

Instance Method Summary collapse

Instance Method Details

#calculate_sizeObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/rookout/com_ws/envelope_wrapper.rb', line 18

def calculate_size
  raise NotImplementedError
end

#envelopeObject

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/rookout/com_ws/envelope_wrapper.rb', line 14

def envelope
  raise NotImplementedError
end

#wrap_in_envelope(message) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rookout/com_ws/envelope_wrapper.rb', line 6

def wrap_in_envelope message
  any_message = Google::Protobuf::Any.pack message
  timestamp = Google::Protobuf::Timestamp.new
  timestamp.from_time Time.new
  envelope = Com::Rookout::Envelope.new msg: any_message, timestamp: timestamp
  Com::Rookout::Envelope.encode envelope
end