Class: ActiveShard::ActiveRecord::ConnectionHandler::PoolKey
- Inherits:
-
Object
- Object
- ActiveShard::ActiveRecord::ConnectionHandler::PoolKey
- Defined in:
- lib/active_shard/active_record/connection_handler.rb
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#shard ⇒ Object
readonly
Returns the value of attribute shard.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(schema, shard) ⇒ PoolKey
constructor
A new instance of PoolKey.
Constructor Details
#initialize(schema, shard) ⇒ PoolKey
Returns a new instance of PoolKey.
130 131 132 133 |
# File 'lib/active_shard/active_record/connection_handler.rb', line 130 def initialize( schema, shard ) @schema = schema.nil? ? nil : schema.to_sym @shard = shard.nil? ? nil : shard.to_sym end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
128 129 130 |
# File 'lib/active_shard/active_record/connection_handler.rb', line 128 def schema @schema end |
#shard ⇒ Object (readonly)
Returns the value of attribute shard.
128 129 130 |
# File 'lib/active_shard/active_record/connection_handler.rb', line 128 def shard @shard end |
Instance Method Details
#eql?(other) ⇒ Boolean
139 140 141 142 |
# File 'lib/active_shard/active_record/connection_handler.rb', line 139 def eql?(other) (self.schema == other.schema && self.shard == other.shard) end |
#hash ⇒ Object
135 136 137 |
# File 'lib/active_shard/active_record/connection_handler.rb', line 135 def hash [self.schema, self.shard].hash end |