Class: NATS::JetStream::API::RawStreamMsg
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/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
Methods inherited from Struct
Constructor Details
#initialize(opts) ⇒ RawStreamMsg
Returns a new instance of RawStreamMsg.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 278 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
277 278 279 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 277 def data @data end |
#headers ⇒ Object
Returns the value of attribute headers
277 278 279 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 277 def headers @headers end |
#seq ⇒ Object
Returns the value of attribute seq
277 278 279 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 277 def seq @seq end |
#subject ⇒ Object
Returns the value of attribute subject
277 278 279 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 277 def subject @subject end |
Instance Method Details
#sequence ⇒ Object
299 300 301 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/api.rb', line 299 def sequence self.seq end |