Class: PgBouncerHero::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/pgbouncerhero/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, config) ⇒ Group

Returns a new instance of Group.



8
9
10
11
12
13
14
# File 'lib/pgbouncerhero/group.rb', line 8

def initialize(id, config)
  @id = id
  @config = config || {}
  @databases = config[id].map do |k, v|
    PgBouncerHero::Database.new(self, k, config[id][k])
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/pgbouncerhero/group.rb', line 6

def config
  @config
end

#databasesObject (readonly)

Returns the value of attribute databases.



6
7
8
# File 'lib/pgbouncerhero/group.rb', line 6

def databases
  @databases
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/pgbouncerhero/group.rb', line 6

def id
  @id
end

Instance Method Details

#nameObject



16
17
18
# File 'lib/pgbouncerhero/group.rb', line 16

def name
  @name ||= id.to_s
end