Class: NATS::JetStream::API::RawStreamMsg
- Inherits:
-
Struct
- Object
- Struct
- NATS::JetStream::API::RawStreamMsg
- Defined in:
- lib/nats/io/jetstream/api.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#seq ⇒ Object
Returns the value of attribute seq.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(opts) ⇒ RawStreamMsg
constructor
A new instance of RawStreamMsg.
- #sequence ⇒ Object
Constructor Details
#initialize(opts) ⇒ RawStreamMsg
Returns a new instance of RawStreamMsg.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/nats/io/jetstream/api.rb', line 282 def initialize(opts) opts[:data] = Base64.decode64(opts[:data]) if opts[:data] if opts[:hdrs] header = Base64.decode64(opts[:hdrs]) hdr = {} lines = header.lines lines.slice(1, header.size).each do |line| line.rstrip! next if line.empty? key, value = line.strip.split(/\s*:\s*/, 2) hdr[key] = value end opts[:headers] = hdr end # Filter out members not present. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
281 282 283 |
# File 'lib/nats/io/jetstream/api.rb', line 281 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers
281 282 283 |
# File 'lib/nats/io/jetstream/api.rb', line 281 def headers @headers end |
#seq ⇒ Object
Returns the value of attribute seq
281 282 283 |
# File 'lib/nats/io/jetstream/api.rb', line 281 def seq @seq end |
#subject ⇒ Object
Returns the value of attribute subject
281 282 283 |
# File 'lib/nats/io/jetstream/api.rb', line 281 def subject @subject end |
Instance Method Details
#sequence ⇒ Object
303 304 305 |
# File 'lib/nats/io/jetstream/api.rb', line 303 def sequence self.seq end |