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.
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 |
# File 'lib/nats/io/js.rb', line 1290 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
1289 1290 1291 |
# File 'lib/nats/io/js.rb', line 1289 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers
1289 1290 1291 |
# File 'lib/nats/io/js.rb', line 1289 def headers @headers end |
#seq ⇒ Object
Returns the value of attribute seq
1289 1290 1291 |
# File 'lib/nats/io/js.rb', line 1289 def seq @seq end |
#subject ⇒ Object
Returns the value of attribute subject
1289 1290 1291 |
# File 'lib/nats/io/js.rb', line 1289 def subject @subject end |
Instance Method Details
#sequence ⇒ Object
1311 1312 1313 |
# File 'lib/nats/io/js.rb', line 1311 def sequence self.seq end |