Module: MongoDoc::Associations::ProxyBase

Included in:
CollectionProxy, DocumentProxy, HashProxy
Defined in:
lib/mongo_doc/associations/proxy_base.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



4
5
6
7
8
# File 'lib/mongo_doc/associations/proxy_base.rb', line 4

def self.included(klass)
  klass.class_eval do
    attr_reader :_assoc_class, :_assoc_name, :_modifier_path, :_root, :_selector_path
  end
end

.is_document?(object) ⇒ Boolean

Returns:



29
30
31
# File 'lib/mongo_doc/associations/proxy_base.rb', line 29

def self.is_document?(object)
  object.respond_to?(:_root)
end

Instance Method Details

#_root=(root) ⇒ Object



18
19
20
# File 'lib/mongo_doc/associations/proxy_base.rb', line 18

def _root=(root)
  @_root = root
end

#initialize(options) ⇒ Object



22
23
24
25
26
27
# File 'lib/mongo_doc/associations/proxy_base.rb', line 22

def initialize(options)
  @_assoc_name = options[:assoc_name]
  @_assoc_class = options[:assoc_class]
  self._root = options[:root]
  self._selector_path = self._modifier_path = options[:path]
end