Module: Ecoportal::API::Common::Content::DoubleModel::DoubleDoc::RootedKey

Extended by:
Includer
Defined in:
lib/ecoportal/api/common/content/double_model/double_doc/rooted_key.rb

Instance Method Summary collapse

Methods included from Includer

include_missing

Instance Method Details

#_rooted_doc_key(value) ⇒ Object

Note:

this method can't be protected. It might be accessed by cousing classes. See last line of this method. parent class to a child class.

Offers a method for child classes to transform the key, provided that the child's doc can be accessed.



25
26
27
28
29
30
31
32
# File 'lib/ecoportal/api/common/content/double_model/double_doc/rooted_key.rb', line 25

def _rooted_doc_key(value)
  #print "!(#{value}<=#{self.class})" if value.is_a?(Content::DoubleModel) && !value.root?
  return value unless value.is_a?(Content::DoubleModel)
  return value if value.root?

  #print "?(#{value.class}<=#{value._parent.class})"
  value._parent._rooted_doc_key(value)
end