Module: Oedipus::DataMapper

Defined in:
lib/oedipus/data_mapper.rb,
lib/oedipus/data_mapper/index.rb,
lib/oedipus/data_mapper/version.rb,
lib/oedipus/data_mapper/collection.rb,
lib/oedipus/data_mapper/pagination.rb,
lib/oedipus/data_mapper/conversions.rb,
lib/oedipus/data_mapper/default_proc.rb

Defined Under Namespace

Modules: Conversions, DefaultProc, Pagination Classes: Collection, Index

Constant Summary collapse

VERSION =
"0.0.7"

Class Method Summary collapse

Class Method Details

.configStruct<host, port>

Returns the configuration options.

Returns:

  • (Struct<host, port>)


40
41
42
# File 'lib/oedipus/data_mapper.rb', line 40

def config
  @config ||= Struct.new(:host, :port, :verify).new("localhost", 9306, true)
end

.configure {|config| ... } ⇒ Object

Set up Oedipus::DataMapper with connection details.

Yields:



26
27
28
# File 'lib/oedipus/data_mapper.rb', line 26

def configure
  yield config
end

.connectionConnection

Returns the configured connection.

Returns:

  • (Connection)


33
34
35
# File 'lib/oedipus/data_mapper.rb', line 33

def connection
  @connection ||= Connection.new(host: config.host, port: config.port, verify: config.verify)
end