Module: Humanoid

Defined in:
lib/humanoid.rb,
lib/humanoid/field.rb,
lib/humanoid/scope.rb,
lib/humanoid/config.rb,
lib/humanoid/cursor.rb,
lib/humanoid/errors.rb,
lib/humanoid/fields.rb,
lib/humanoid/factory.rb,
lib/humanoid/finders.rb,
lib/humanoid/indexes.rb,
lib/humanoid/commands.rb,
lib/humanoid/contexts.rb,
lib/humanoid/criteria.rb,
lib/humanoid/document.rb,
lib/humanoid/identity.rb,
lib/humanoid/matchers.rb,
lib/humanoid/callbacks.rb,
lib/humanoid/attributes.rb,
lib/humanoid/collection.rb,
lib/humanoid/components.rb,
lib/humanoid/timestamps.rb,
lib/humanoid/versioning.rb,
lib/humanoid/enslavement.rb,
lib/humanoid/matchers/gt.rb,
lib/humanoid/matchers/in.rb,
lib/humanoid/matchers/lt.rb,
lib/humanoid/matchers/ne.rb,
lib/humanoid/memoization.rb,
lib/humanoid/named_scope.rb,
lib/humanoid/associations.rb,
lib/humanoid/contexts/ids.rb,
lib/humanoid/matchers/all.rb,
lib/humanoid/matchers/gte.rb,
lib/humanoid/matchers/lte.rb,
lib/humanoid/matchers/nin.rb,
lib/humanoid/commands/save.rb,
lib/humanoid/matchers/size.rb,
lib/humanoid/contexts/mongo.rb,
lib/humanoid/commands/create.rb,
lib/humanoid/commands/delete.rb,
lib/humanoid/contexts/paging.rb,
lib/humanoid/matchers/exists.rb,
lib/humanoid/commands/destroy.rb,
lib/humanoid/matchers/default.rb,
lib/humanoid/collections/mimic.rb,
lib/humanoid/commands/deletion.rb,
lib/humanoid/criterion/complex.rb,
lib/humanoid/associations/proxy.rb,
lib/humanoid/collections/master.rb,
lib/humanoid/collections/slaves.rb,
lib/humanoid/criterion/optional.rb,
lib/humanoid/commands/delete_all.rb,
lib/humanoid/contexts/enumerable.rb,
lib/humanoid/criterion/exclusion.rb,
lib/humanoid/criterion/inclusion.rb,
lib/humanoid/associations/has_one.rb,
lib/humanoid/associations/options.rb,
lib/humanoid/commands/destroy_all.rb,
lib/humanoid/associations/has_many.rb,
lib/humanoid/collections/operations.rb,
lib/humanoid/associations/belongs_to.rb,
lib/humanoid/extensions/hash/scoping.rb,
lib/humanoid/extensions/proc/scoping.rb,
lib/humanoid/extensions/hash/accessors.rb,
lib/humanoid/extensions/array/accessors.rb,
lib/humanoid/collections/cyclic_iterator.rb,
lib/humanoid/extensions/date/conversions.rb,
lib/humanoid/extensions/hash/conversions.rb,
lib/humanoid/extensions/nil/assimilation.rb,
lib/humanoid/extensions/time/conversions.rb,
lib/humanoid/associations/has_one_related.rb,
lib/humanoid/extensions/array/conversions.rb,
lib/humanoid/extensions/float/conversions.rb,
lib/humanoid/extensions/hash/assimilation.rb,
lib/humanoid/associations/has_many_related.rb,
lib/humanoid/extensions/array/assimilation.rb,
lib/humanoid/extensions/object/conversions.rb,
lib/humanoid/extensions/string/conversions.rb,
lib/humanoid/extensions/string/inflections.rb,
lib/humanoid/extensions/symbol/inflections.rb,
lib/humanoid/extensions/array/parentization.rb,
lib/humanoid/extensions/boolean/conversions.rb,
lib/humanoid/extensions/integer/conversions.rb,
lib/humanoid/associations/belongs_to_related.rb,
lib/humanoid/extensions/datetime/conversions.rb,
lib/humanoid/extensions/hash/criteria_helpers.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Associations, Attributes, Callbacks, Collections, Commands, Components, Contexts, Criterion, Document, Enslavement, Errors, Extensions, Fields, Finders, Indexes, Matchers, Memoization, NamedScope, Timestamps, Versioning Classes: Collection, Config, Criteria, Cursor, Factory, Field, Identity, Scope

Class Method Summary collapse

Class Method Details

.configureObject Also known as: config

Sets the Humanoid configuration options. Best used by passing a block.

Example:

Humanoid.configure do |config|
  name = "humanoid_test"
  host = "localhost"
  config.allow_dynamic_fields = false
  config.master = Mongo::Connection.new.db(name)
  config.slaves = [
    Mongo::Connection.new(host, 27018, :slave_ok => true).db(name),
    Mongo::Connection.new(host, 27019, :slave_ok => true).db(name)
  ]
end

Returns:

The Humanoid Config singleton instance.



90
91
92
93
# File 'lib/humanoid.rb', line 90

def configure
  config = Config.instance
  block_given? ? yield(config) : config
end