Class: NATS::Services

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

Instance Attribute Summary collapse

Attributes inherited from Utils::List

#parent

Instance Method Summary collapse

Methods inherited from Utils::List

#each, #insert

Constructor Details

#initialize(client) ⇒ Services

Returns a new instance of Services.



107
108
109
110
# File 'lib/nats/service.rb', line 107

def initialize(client)
  @client = client
  super
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



105
106
107
# File 'lib/nats/service.rb', line 105

def client
  @client
end

Instance Method Details

#add(options) ⇒ Object



112
113
114
115
116
117
118
119
# File 'lib/nats/service.rb', line 112

def add(options)
  client.synchronize do
    service = NATS::Service.new(client, options)
    insert(service)

    service
  end
end