louismullie/treat — pull request #20 by automatedtendencies (2012-08-01 18:08:52+00:00)
Title: Added value checking & recursion to num_children_with_feature

New def => def num_children_with_feature(feature, recursive = false, value = nil)

1.9.3p194 :011 > p.num_children_with_feature(:tag)
=> 0 # No recursion
1.9.3p194 :012 > p.num_children_with_feature(:tag,true)
=> 50 # Recursion
1.9.3p194 :013 > p.num_children_with_feature(:tag,true,"NP")
=> 10 # Recursion & value checking.

Didn't change the order for feature & defaulted recursion to false so old code running it will still work in the same way.