Module: Yapper::Document

Extended by:
MotionSupport::Concern
Includes:
Callbacks, Persistence, Relation, Selection
Defined in:
lib/yapper/document.rb,
lib/yapper/document/relation.rb,
lib/yapper/document/callbacks.rb,
lib/yapper/document/selection.rb,
lib/yapper/document/persistence.rb

Defined Under Namespace

Modules: Callbacks, ClassMethods, Persistence, Relation, Selection Classes: Criteria

Instance Method Summary collapse

Methods included from Callbacks

disabled, disabled?, postpone_callback, postpone_callbacks, postponed_callbacks, #run_callback, #run_callbacks

Methods included from Persistence

#assign_attributes, #destroy, #destroyed?, #initialize, #new_record?, #persisted?, #reload, #save, #set_attribute, #update_attributes, #was_new?

Instance Method Details

#==(other) ⇒ Object Also known as: eql?

TODO Add specs



49
50
51
# File 'lib/yapper/document.rb', line 49

def ==(other)
  self.id == other.try(:id)
end

#_typeObject



36
37
38
# File 'lib/yapper/document.rb', line 36

def _type
  self.class._type
end

#dbObject



40
41
42
# File 'lib/yapper/document.rb', line 40

def db
  self.class.db
end

#hashObject



54
55
56
# File 'lib/yapper/document.rb', line 54

def hash
  self.id.hash
end

#model_nameObject



44
45
46
# File 'lib/yapper/document.rb', line 44

def model_name
  self.class.model_name
end