Class: Mongoid::DocumentPath::Node

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document
Defined in:
lib/mongoid/document_path/node.rb

Instance Method Summary collapse

Instance Method Details

#matches?(document) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/mongoid/document_path/node.rb', line 10

def matches?(document)
  document.class.name == type && document.id.to_s == document_id
end

#terminal?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/mongoid/document_path/node.rb', line 14

def terminal?
  relation.blank?
end