Module: DataObjects

Defined in:
lib/data_objects/utilities.rb,
lib/data_objects/uri.rb,
lib/data_objects/error.rb,
lib/data_objects/logger.rb,
lib/data_objects/reader.rb,
lib/data_objects/result.rb,
lib/data_objects/command.rb,
lib/data_objects/pooling.rb,
lib/data_objects/quoting.rb,
lib/data_objects/version.rb,
lib/data_objects/extension.rb,
lib/data_objects/connection.rb,
lib/data_objects/transaction.rb,
lib/data_objects/error/sql_error.rb,
lib/data_objects/error/data_error.rb,
lib/data_objects/error/syntax_error.rb,
lib/data_objects/error/integrity_error.rb,
lib/data_objects/error/connection_error.rb,
lib/data_objects/error/transaction_error.rb,
lib/data_objects/spec/lib/pending_helpers.rb

Overview

This is here to remove DataObject’s dependency on Extlib.

Defined Under Namespace

Modules: Logging, Pooling, Quoting, Spec Classes: Command, Connection, ConnectionError, DataError, Error, Extension, IntegrityError, Logger, Reader, Result, SQLError, SavePoint, SyntaxError, Transaction, TransactionError, URI

Constant Summary collapse

VERSION =
'0.10.17'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

The global logger for DataObjects



16
17
18
# File 'lib/data_objects/logger.rb', line 16

def logger
  @logger
end

Class Method Details

.exitingObject



7
8
9
10
11
# File 'lib/data_objects/pooling.rb', line 7

def self.exiting
  return @exiting if defined?(@exiting)

  @exiting = false
end

.exiting=(bool) ⇒ Object



2
3
4
5
# File 'lib/data_objects/pooling.rb', line 2

def self.exiting=(bool)
  DataObjects::Pooling.scavenger&.wakeup if bool && DataObjects.const_defined?('Pooling') && DataObjects::Pooling.scavenger?
  @exiting = true
end

.full_const_get(name) ⇒ Object

Returns The constant corresponding to the name.

Parameters:

  • name (String)

    The name of the constant to get, e.g. “Merb::Router”.

Returns:

  • (Object)

    The constant corresponding to the name.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/data_objects/utilities.rb', line 7

def self.full_const_get(name)
  list = name.split('::')
  list.shift if list.first.nil? || list.first&.strip&.empty?
  obj = ::Object
  list.each do |x|
    # This is required because const_get tries to look for constants in the
    # ancestor chain, but we only want constants that are HERE
    obj = obj.const_defined?(x) ? obj.const_get(x) : obj.const_missing(x)
  end
  obj
end