Class: NATS::JetStream::API::RawStreamMsg
- Inherits:
-
Struct
- Object
- Struct
- NATS::JetStream::API::RawStreamMsg
- Defined in:
- lib/nats/io/js.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.
1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 |
# File 'lib/nats/io/js.rb', line 1407 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
1406 1407 1408 |
# File 'lib/nats/io/js.rb', line 1406 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers
1406 1407 1408 |
# File 'lib/nats/io/js.rb', line 1406 def headers @headers end |
#seq ⇒ Object
Returns the value of attribute seq
1406 1407 1408 |
# File 'lib/nats/io/js.rb', line 1406 def seq @seq end |
#subject ⇒ Object
Returns the value of attribute subject
1406 1407 1408 |
# File 'lib/nats/io/js.rb', line 1406 def subject @subject end |
Instance Method Details
#sequence ⇒ Object
1428 1429 1430 |
# File 'lib/nats/io/js.rb', line 1428 def sequence self.seq end |