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.
7 8 9 10 11 12 13 |
# File 'lib/pgbouncerhero/group.rb', line 7 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.
5 6 7 |
# File 'lib/pgbouncerhero/group.rb', line 5 def config @config end |
#databases ⇒ Object (readonly)
Returns the value of attribute databases.
5 6 7 |
# File 'lib/pgbouncerhero/group.rb', line 5 def databases @databases end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/pgbouncerhero/group.rb', line 5 def id @id end |
Instance Method Details
#name ⇒ Object
15 16 17 |
# File 'lib/pgbouncerhero/group.rb', line 15 def name @name ||= id.to_s end |