Class: JetstreamBridge::TestHelpers::MockNats::MockConsumer
- Inherits:
-
Object
- Object
- JetstreamBridge::TestHelpers::MockNats::MockConsumer
- Defined in:
- lib/jetstream_bridge/test_helpers/mock_nats.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(name:, stream:, config:) ⇒ MockConsumer
constructor
A new instance of MockConsumer.
Constructor Details
#initialize(name:, stream:, config:) ⇒ MockConsumer
475 476 477 478 479 |
# File 'lib/jetstream_bridge/test_helpers/mock_nats.rb', line 475 def initialize(name:, stream:, config:) @name = name @stream = stream @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
473 474 475 |
# File 'lib/jetstream_bridge/test_helpers/mock_nats.rb', line 473 def config @config end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
473 474 475 |
# File 'lib/jetstream_bridge/test_helpers/mock_nats.rb', line 473 def name @name end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
473 474 475 |
# File 'lib/jetstream_bridge/test_helpers/mock_nats.rb', line 473 def stream @stream end |
Instance Method Details
#info ⇒ Object
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/jetstream_bridge/test_helpers/mock_nats.rb', line 481 def info OpenStruct.new( name: @name, stream_name: @stream, config: OpenStruct.new( durable_name: @name, ack_policy: @config[:ack_policy] || 'explicit', max_deliver: @config[:max_deliver] || 5, ack_wait: @config[:ack_wait] || 30_000_000_000, filter_subject: @config[:filter_subject] || '', replay_policy: @config[:replay_policy] || 'instant' ), num_pending: 0, num_delivered: 0 ) end |