Class: PgBouncerHero::Group
- Inherits:
-
Object
- Object
- PgBouncerHero::Group
- Defined in:
- lib/pgbouncerhero/group.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#databases ⇒ Object
readonly
Returns the value of attribute databases.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, config) ⇒ Group
constructor
A new instance of Group.
- #name ⇒ Object
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
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/pgbouncerhero/group.rb', line 6 def config @config end |
#databases ⇒ Object (readonly)
Returns the value of attribute databases.
6 7 8 |
# File 'lib/pgbouncerhero/group.rb', line 6 def databases @databases end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/pgbouncerhero/group.rb', line 6 def id @id end |
Instance Method Details
#name ⇒ Object
16 17 18 |
# File 'lib/pgbouncerhero/group.rb', line 16 def name @name ||= id.to_s end |