Class: ActiveShard::ActiveRecord::ConnectionHandler::PoolKey

Inherits:
Object
  • Object
show all
Defined in:
lib/active_shard/active_record/connection_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#schemaObject (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

#shardObject (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

Returns:

  • (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

#hashObject



135
136
137
# File 'lib/active_shard/active_record/connection_handler.rb', line 135

def hash
  [self.schema, self.shard].hash
end