Class: NATS::JetStream::API::StreamInfo

Inherits:
Struct
  • Object
show all
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

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

#configHash

Returns:

  • (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

#createdString

Returns:

  • (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

#domainString

Returns:

  • (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

#stateHash

Returns:

  • (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

#typeString

Returns:

  • (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