Class: NATS::JetStream::API::StreamInfo
- Inherits:
-
Struct
- Object
- Struct
- NATS::JetStream::API::StreamInfo
- Defined in:
- lib/nats/io/jetstream/api.rb
Overview
StreamInfo is the info about a stream from JetStream.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ StreamInfo
constructor
A new instance of StreamInfo.
Constructor Details
#initialize(opts = {}) ⇒ StreamInfo
Returns a new instance of StreamInfo.
222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/nats/io/jetstream/api.rb', line 222 def initialize(opts={}) opts[:config] = StreamConfig.new(opts[:config]) opts[:state] = StreamState.new(opts[:state]) opts[:created] = ::Time.parse(opts[:created]) # Filter fields and freeze. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) freeze end |
Instance Attribute Details
#config ⇒ Hash
220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/nats/io/jetstream/api.rb', line 220 StreamInfo = Struct.new(:type, :config, :created, :state, :domain, keyword_init: true) do def initialize(opts={}) opts[:config] = StreamConfig.new(opts[:config]) opts[:state] = StreamState.new(opts[:state]) opts[:created] = ::Time.parse(opts[:created]) # Filter fields and freeze. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) freeze end end |
#created ⇒ String
220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/nats/io/jetstream/api.rb', line 220 StreamInfo = Struct.new(:type, :config, :created, :state, :domain, keyword_init: true) do def initialize(opts={}) opts[:config] = StreamConfig.new(opts[:config]) opts[:state] = StreamState.new(opts[:state]) opts[:created] = ::Time.parse(opts[:created]) # Filter fields and freeze. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) freeze end end |
#domain ⇒ String
220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/nats/io/jetstream/api.rb', line 220 StreamInfo = Struct.new(:type, :config, :created, :state, :domain, keyword_init: true) do def initialize(opts={}) opts[:config] = StreamConfig.new(opts[:config]) opts[:state] = StreamState.new(opts[:state]) opts[:created] = ::Time.parse(opts[:created]) # Filter fields and freeze. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) freeze end end |
#state ⇒ Hash
220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/nats/io/jetstream/api.rb', line 220 StreamInfo = Struct.new(:type, :config, :created, :state, :domain, keyword_init: true) do def initialize(opts={}) opts[:config] = StreamConfig.new(opts[:config]) opts[:state] = StreamState.new(opts[:state]) opts[:created] = ::Time.parse(opts[:created]) # Filter fields and freeze. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) freeze end end |
#type ⇒ String
220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/nats/io/jetstream/api.rb', line 220 StreamInfo = Struct.new(:type, :config, :created, :state, :domain, keyword_init: true) do def initialize(opts={}) opts[:config] = StreamConfig.new(opts[:config]) opts[:state] = StreamState.new(opts[:state]) opts[:created] = ::Time.parse(opts[:created]) # Filter fields and freeze. rem = opts.keys - members opts.delete_if { |k| rem.include?(k) } super(opts) freeze end end |