Module: MarkMapper

Extended by:
Connection
Defined in:
lib/mark_mapper/extensions/time.rb,
lib/mark_mapper.rb,
lib/mark_mapper/query.rb,
lib/mark_mapper/plugins.rb,
lib/mark_mapper/version.rb,
lib/mark_mapper/railtie.rb,
lib/mark_mapper/document.rb,
lib/mark_mapper/connection.rb,
lib/mark_mapper/pagination.rb,
lib/mark_mapper/exceptions.rb,
lib/mark_mapper/translation.rb,
lib/mark_mapper/plugins/sci.rb,
lib/mark_mapper/plugins/keys.rb,
lib/mark_mapper/options_hash.rb,
lib/mark_mapper/plugins/clone.rb,
lib/mark_mapper/plugins/dirty.rb,
lib/mark_mapper/plugins/rails.rb,
lib/mark_mapper/criteria_hash.rb,
lib/mark_mapper/plugins/touch.rb,
lib/mark_mapper/extensions/set.rb,
lib/mark_mapper/plugins/scopes.rb,
lib/mark_mapper/plugins/logger.rb,
lib/mark_mapper/plugins/inspect.rb,
lib/mark_mapper/plugins/caching.rb,
lib/mark_mapper/extensions/hash.rb,
lib/mark_mapper/extensions/date.rb,
lib/mark_mapper/extensions/float.rb,
lib/mark_mapper/plugins/keys/key.rb,
lib/mark_mapper/plugins/querying.rb,
lib/mark_mapper/plugins/document.rb,
lib/mark_mapper/plugins/dumpable.rb,
lib/mark_mapper/extensions/array.rb,
lib/mark_mapper/plugins/equality.rb,
lib/mark_mapper/extensions/string.rb,
lib/mark_mapper/plugins/modifiers.rb,
lib/mark_mapper/plugins/callbacks.rb,
lib/mark_mapper/extensions/symbol.rb,
lib/mark_mapper/embedded_document.rb,
lib/mark_mapper/plugins/protected.rb,
lib/mark_mapper/plugins/indexable.rb,
lib/mark_mapper/extensions/object.rb,
lib/mark_mapper/plugins/pagination.rb,
lib/mark_mapper/extensions/integer.rb,
lib/mark_mapper/extensions/boolean.rb,
lib/mark_mapper/plugins/accessible.rb,
lib/mark_mapper/plugins/userstamps.rb,
lib/mark_mapper/plugins/timestamps.rb,
lib/mark_mapper/plugins/validations.rb,
lib/mark_mapper/plugins/keys/static.rb,
lib/mark_mapper/plugins/persistence.rb,
lib/mark_mapper/normalizers/integer.rb,
lib/mark_mapper/extensions/object_id.rb,
lib/mark_mapper/pagination/paginator.rb,
lib/mark_mapper/plugins/identity_map.rb,
lib/mark_mapper/normalizers/hash_key.rb,
lib/mark_mapper/plugins/associations.rb,
lib/mark_mapper/extensions/nil_class.rb,
lib/mark_mapper/plugins/active_model.rb,
lib/mark_mapper/plugins/counter_cache.rb,
lib/mark_mapper/plugins/serialization.rb,
lib/mark_mapper/pagination/collection.rb,
lib/mark_mapper/normalizers/sort_value.rb,
lib/mark_mapper/middleware/identity_map.rb,
lib/mark_mapper/plugins/partial_updates.rb,
lib/mark_mapper/normalizers/fields_value.rb,
lib/mark_mapper/plugins/dynamic_querying.rb,
lib/mark_mapper/plugins/embedded_document.rb,
lib/mark_mapper/plugins/associations/base.rb,
lib/mark_mapper/plugins/embedded_callbacks.rb,
lib/mark_mapper/plugins/associations/proxy.rb,
lib/mark_mapper/normalizers/criteria_hash_key.rb,
lib/mark_mapper/plugins/associations/one_proxy.rb,
lib/mark_mapper/normalizers/options_hash_value.rb,
lib/mark_mapper/plugins/associations/collection.rb,
lib/mark_mapper/normalizers/criteria_hash_value.rb,
lib/mark_mapper/plugins/associations/one_as_proxy.rb,
lib/mark_mapper/plugins/associations/in_array_proxy.rb,
lib/mark_mapper/plugins/associations/one_association.rb,
lib/mark_mapper/plugins/associations/belongs_to_proxy.rb,
lib/mark_mapper/plugins/associations/many_association.rb,
lib/rails/generators/mark_mapper/model/model_generator.rb,
lib/mark_mapper/plugins/associations/one_embedded_proxy.rb,
lib/mark_mapper/plugins/associations/single_association.rb,
lib/mark_mapper/plugins/dynamic_querying/dynamic_finder.rb,
lib/mark_mapper/plugins/associations/embedded_collection.rb,
lib/mark_mapper/plugins/associations/many_embedded_proxy.rb,
lib/rails/generators/mark_mapper/config/config_generator.rb,
lib/mark_mapper/plugins/associations/many_documents_proxy.rb,
lib/mark_mapper/plugins/querying/decorated_markmapper_query.rb,
lib/mark_mapper/plugins/associations/many_polymorphic_proxy.rb,
lib/mark_mapper/plugins/associations/belongs_to_association.rb,
lib/mark_mapper/plugins/associations/many_documents_as_proxy.rb,
lib/mark_mapper/plugins/rails/active_record_association_adapter.rb,
lib/mark_mapper/plugins/associations/belongs_to_polymorphic_proxy.rb,
lib/mark_mapper/plugins/associations/one_embedded_polymorphic_proxy.rb,
lib/mark_mapper/plugins/associations/many_embedded_polymorphic_proxy.rb

Overview

encoding: UTF-8

Defined Under Namespace

Modules: Connection, Document, EmbeddedDocument, Extensions, Generators, Middleware, Normalizers, Pagination, Plugins, Translation Classes: AccessibleOrProtected, CriteriaHash, DocumentNotFound, DocumentNotValid, Error, InvalidKey, InvalidScheme, NotSupported, OptionsHash, Query, Railtie

Constant Summary collapse

Methods =
MarkMapper::Query::DSL.instance_methods.sort.map(&:to_sym)
ModifierString =

Private

'$'
Version =
'0.0.6'

Class Method Summary collapse

Methods included from Connection

application, application=, config, config=, config_for_environment, connect, connection, connection=, connection?, database, database=, logger, setup

Class Method Details

.modifier?(key) ⇒ Boolean

Internal

Returns:


113
114
115
# File 'lib/mark_mapper.rb', line 113

def self.modifier?(key)
  key.to_s[0, 1] == ModifierString
end

.to_object_id(value) ⇒ Object


98
99
100
101
102
103
104
105
106
107
# File 'lib/mark_mapper.rb', line 98

def self.to_object_id(value)
  return value if value.is_a?(MarkLogic::ObjectId)
  return nil   if value.nil? || (value.respond_to?(:empty?) && value.empty?)

  if MarkLogic::ObjectId.legal?(value.to_s)
    MarkLogic::ObjectId.from_string(value.to_s)
  else
    value
  end
end