Class: NATS::Service::Endpoints

Inherits:
Utils::List show all
Defined in:
lib/nats/service/endpoint.rb

Instance Attribute Summary

Attributes inherited from Utils::List

#parent

Instance Method Summary collapse

Methods inherited from Utils::List

#each, #initialize, #insert

Constructor Details

This class inherits a constructor from NATS::Utils::List

Instance Method Details

#add(name, options = {}, &block) ⇒ Object



140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/nats/service/endpoint.rb', line 140

def add(name, options = {}, &block)
  endpoint = Endpoint.new(
    name: name,
    options: options,
    parent: parent,
    &block
  )

  insert(endpoint)
  parent.service.endpoints.insert(endpoint)

  endpoint
end