Class: NATS::KeyValue::BucketStatus
- Inherits:
-
Object
- Object
- NATS::KeyValue::BucketStatus
- Defined in:
- lib/nats/io/kv/bucket_status.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#stream_info ⇒ Object
readonly
Returns the value of attribute stream_info.
Instance Method Summary collapse
- #history ⇒ Object
-
#initialize(info, bucket) ⇒ BucketStatus
constructor
A new instance of BucketStatus.
- #ttl ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(info, bucket) ⇒ BucketStatus
Returns a new instance of BucketStatus.
22 23 24 25 |
# File 'lib/nats/io/kv/bucket_status.rb', line 22 def initialize(info, bucket) @stream_info = info @bucket = bucket end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
20 21 22 |
# File 'lib/nats/io/kv/bucket_status.rb', line 20 def bucket @bucket end |
#stream_info ⇒ Object (readonly)
Returns the value of attribute stream_info.
20 21 22 |
# File 'lib/nats/io/kv/bucket_status.rb', line 20 def stream_info @stream_info end |
Instance Method Details
#history ⇒ Object
31 32 33 |
# File 'lib/nats/io/kv/bucket_status.rb', line 31 def history @stream_info.config.max_msgs_per_subject end |
#ttl ⇒ Object
35 36 37 |
# File 'lib/nats/io/kv/bucket_status.rb', line 35 def ttl @stream_info.config.max_age / ::NATS::NANOSECONDS end |
#values ⇒ Object
27 28 29 |
# File 'lib/nats/io/kv/bucket_status.rb', line 27 def values @stream_info.state. end |