Class: NATS::JetStream::Msg::Metadata

Inherits:
Object
  • Object
show all
Defined in:
lib/nats/io/js.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Metadata

Returns a new instance of Metadata.



724
725
726
727
728
729
730
731
732
733
734
# File 'lib/nats/io/js.rb', line 724

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

#consumerObject (readonly)

Returns the value of attribute consumer.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def consumer
  @consumer
end

#domainObject (readonly)

Returns the value of attribute domain.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def domain
  @domain
end

#num_deliveredObject (readonly)

Returns the value of attribute num_delivered.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def num_delivered
  @num_delivered
end

#num_pendingObject (readonly)

Returns the value of attribute num_pending.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def num_pending
  @num_pending
end

#sequenceObject (readonly)

Returns the value of attribute sequence.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def sequence
  @sequence
end

#streamObject (readonly)

Returns the value of attribute stream.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def stream
  @stream
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



722
723
724
# File 'lib/nats/io/js.rb', line 722

def timestamp
  @timestamp
end