Class: Sequel::Mock::Connection
Overview
Connection class for Sequel’s mock adapter.
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Sequel::Mock::Database object that created this connection.
-
#opts ⇒ Object
readonly
The specific database options for this connection.
-
#server ⇒ Object
readonly
Shard this connection operates on, when using Sequel’s sharding support (always :default for databases not using sharding).
Instance Method Summary collapse
-
#execute(sql) ⇒ Object
Delegate to the db’s #_execute method.
-
#initialize(db, server, opts) ⇒ Connection
constructor
Store the db, server, and opts.
Constructor Details
#initialize(db, server, opts) ⇒ Connection
Store the db, server, and opts.
17 18 19 20 21 |
# File 'lib/sequel/adapters/mock.rb', line 17 def initialize(db, server, opts) @db = db @server = server @opts = opts end |
Instance Attribute Details
#db ⇒ Object (readonly)
Sequel::Mock::Database object that created this connection
6 7 8 |
# File 'lib/sequel/adapters/mock.rb', line 6 def db @db end |
#opts ⇒ Object (readonly)
The specific database options for this connection.
14 15 16 |
# File 'lib/sequel/adapters/mock.rb', line 14 def opts @opts end |
#server ⇒ Object (readonly)
Shard this connection operates on, when using Sequel’s sharding support (always :default for databases not using sharding).
11 12 13 |
# File 'lib/sequel/adapters/mock.rb', line 11 def server @server end |
Instance Method Details
#execute(sql) ⇒ Object
Delegate to the db’s #_execute method.
24 25 26 |
# File 'lib/sequel/adapters/mock.rb', line 24 def execute(sql) @db.send(:_execute, self, sql, :log=>false) end |