require_relative "counter"

module Measurement
  class ConditionCounter < Counter

    private

    def leaves(node)
      if node.respond_to?(:children) && !node.children.empty?
        node.children.flat_map { |child| leaves(child) }
      else
        [node]
      end
    end
  end
end

require_relative "counter"

module Measurement
  class ConditionCounter < Counter
  end
end

--- 
+++ 
@@ -2,5 +2,15 @@
 
 module Measurement
   class ConditionCounter < Counter
+
+    private
+
+    def leaves(node)
+      if node.respond_to?(:children) && !node.children.empty?
+        node.children.flat_map { |child| leaves(child) }
+      else
+        [node]
+      end
+    end
   end
 end
Add leaves method to ConditionCounter for ABC metric.
