lib/kitchen/ancestor.rb
# Decreases the descendant count for the given type by some amount
#
# @param descendant_type [String, Symbol] the descendent's type
# @param by [Integer] the amount by which to decrement
# @raise [RangeError] if descendant count is a negative number
#
Decreases the descendant count for the given type by some amount
Decreases the descendant count for the given type by some amount
def decrement_descendant_count(descendant_type, by: 1)
      raise(RangeError, 'An element cannot have negative descendants') \
        if (get_descendant_count(descendant_type) - by).negative?
      @descendant_counts[descendant_type.to_sym] = get_descendant_count(descendant_type) - by
    end
def decrement_descendant_count ( descendant_type , by : 1 ) raise ( RangeError , 'An element cannot have negative descendants' ) if ( get_descendant_count ( descendant_type ) - by ) . negative? @descendant_counts [ descendant_type . to_sym ] = get_descendant_count ( descendant_type ) - by end
Decreases the descendant count for the given type by some amount
Decreases the descendant count for the given type by some amount
[RangeError] if descendant count is a negative number
[ RangeError ] if descendant count is a negative number
descendant_type
the descendent's type
the descendent ' s type
by
the amount by which to decrement
the amount by which to decrement