Class: NATS::KeyValue::BucketStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/bucket_status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info, bucket) ⇒ BucketStatus

Returns a new instance of BucketStatus.



20
21
22
23
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/bucket_status.rb', line 20

def initialize(info, bucket)
  @nfo = info
  @bucket = bucket
end

Instance Attribute Details

#bucketObject (readonly)

Returns the value of attribute bucket.



18
19
20
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/bucket_status.rb', line 18

def bucket
  @bucket
end

Instance Method Details

#historyObject



29
30
31
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/bucket_status.rb', line 29

def history
  @nfo.config.max_msgs_per_subject
end

#ttlObject



33
34
35
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/bucket_status.rb', line 33

def ttl
  @nfo.config.max_age / ::NATS::NANOSECONDS
end

#valuesObject



25
26
27
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/nats-pure-2.2.1/lib/nats/io/kv/bucket_status.rb', line 25

def values
  @nfo.state.messages
end