Class: NATS::JetStream::Msg::Metadata
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb
Instance Attribute Summary collapse
-
#consumer ⇒ Object
readonly
Returns the value of attribute consumer.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#num_delivered ⇒ Object
readonly
Returns the value of attribute num_delivered.
-
#num_pending ⇒ Object
readonly
Returns the value of attribute num_pending.
-
#sequence ⇒ Object
readonly
Returns the value of attribute sequence.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Metadata
constructor
A new instance of Metadata.
Constructor Details
#initialize(opts) ⇒ Metadata
Returns a new instance of Metadata.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 23 def initialize(opts) @sequence = Ack::SequencePair.new(opts[Ack::StreamSeq].to_i, opts[Ack::ConsumerSeq].to_i) @domain = opts[Ack::Domain] @num_delivered = opts[Ack::NumDelivered].to_i @num_pending = opts[Ack::NumPending].to_i @timestamp = Time.at((opts[Ack::Timestamp].to_i / 1_000_000_000.0)) @stream = opts[Ack::Stream] @consumer = opts[Ack::Consumer] # TODO: Not exposed in Go client either right now. # account = opts[Ack::AccHash] end |
Instance Attribute Details
#consumer ⇒ Object (readonly)
Returns the value of attribute consumer.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def consumer @consumer end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def domain @domain end |
#num_delivered ⇒ Object (readonly)
Returns the value of attribute num_delivered.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def num_delivered @num_delivered end |
#num_pending ⇒ Object (readonly)
Returns the value of attribute num_pending.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def num_pending @num_pending end |
#sequence ⇒ Object (readonly)
Returns the value of attribute sequence.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def sequence @sequence end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def stream @stream end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
21 22 23 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/jetstream/msg/metadata.rb', line 21 def @timestamp end |