Class: NATS::Service::Groups

Inherits:
Utils::List show all
Defined in:
lib/nats/service/group.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, queue: nil) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/nats/service/group.rb', line 23

def add(name, queue: nil)
  group = Group.new(
    name: name,
    queue: queue,
    parent: parent
  )

  insert(group)
  parent.service.groups.insert(group)

  group
end