Sha256: e68340b010b34a5797ca992d854012e73d27c1d68c22896bb2f91c407c7f5313
Contents?: true
Size: 604 Bytes
Versions: 18
Compression:
Stored size: 604 Bytes
Contents
# encoding: utf-8 module CollectiveIdea #:nodoc: module Acts #:nodoc: module NestedSet #:nodoc: module Descendants # Returns the number of nested children of this object. def descendants_count return (right - left - 1)/2 end def has_descendants? !descendants_count.zero? end def move_by_direction(ditection) return if ditection.blank? case ditection.to_sym when :up, :left then move_left when :down, :right then move_right end end end end end end
Version data entries
18 entries across 18 versions & 3 rubygems