Class: NATS::JetStream::Msg::Metadata
- Inherits:
-
Object
- Object
- NATS::JetStream::Msg::Metadata
- Defined in:
- lib/nats/io/js.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.
822 823 824 825 826 827 828 829 830 831 832 |
# File 'lib/nats/io/js.rb', line 822 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.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def consumer @consumer end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def domain @domain end |
#num_delivered ⇒ Object (readonly)
Returns the value of attribute num_delivered.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def num_delivered @num_delivered end |
#num_pending ⇒ Object (readonly)
Returns the value of attribute num_pending.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def num_pending @num_pending end |
#sequence ⇒ Object (readonly)
Returns the value of attribute sequence.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def sequence @sequence end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def stream @stream end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
820 821 822 |
# File 'lib/nats/io/js.rb', line 820 def @timestamp end |