lib/fertile_forest/modules/finders.rb
#
# Find nth-sibling node from base node.
#
# @param base_obj [Entity|Integer] Base node|id to find.
# @param nth [Integer] Order in child nodes.
# @param [Array] columns  Columns for SELECT clause.
# @return [Entity] Nth-sibling node.
# @return [nil] No nth-sibling node.
#
Find nth-sibling node from base node.
Find nth - sibling node from base node .
def nth_sibling(base_obj, nth = 0, columns = nil)
            base_node = ff_resolve_nodes(base_obj)
            return nil if base_node.blank?
            parent_node = genitor(base_node)
            return nil if parent_node.blank?
            nth = nth.to_i
            nth_child(parent_node, nth, columns)
          end
def nth_sibling ( base_obj , nth = 0 , columns = nil ) base_node = ff_resolve_nodes ( base_obj ) return nil if base_node . blank? parent_node = genitor ( base_node ) return nil if parent_node . blank? nth = nth . to_i nth_child ( parent_node , nth , columns ) end
Find nth-sibling node from base node.
Find nth - sibling node from base node .
None
Entity
No nth-sibling node.
No nth - sibling node .
nil
base_obj
Base node|id to find.
Base node|id to find .
nth
Order in child nodes.
Order in child nodes .
columns
<not_specific>
<not_specific>
columns Columns for SELECT clause.
columns Columns for SELECT clause .