Module: Rubyists::Leopard::NatsServiceDiscovery::Operation::DiscoveryOptions

Included in:
Services, SubjectMap
Defined in:
lib/leopard/nats_service_discovery/operation/discovery_options.rb

Overview

Shared option extraction for operations that compose other discovery operations.

Instance Method Summary collapse

Instance Method Details

#operation_options(ctx) ⇒ Hash (private)

Extracts the common discovery options from a Trailblazer context.

Parameters:

  • Operation context.

Returns:

  • Arguments suitable for another discovery operation.



18
19
20
21
22
23
24
25
26
# File 'lib/leopard/nats_service_discovery/operation/discovery_options.rb', line 18

def operation_options(ctx)
  {
    client: ctx[:client],
    prefix: ctx[:prefix],
    timeout: ctx[:timeout],
    name: ctx[:name],
    id: ctx[:id],
  }
end