Method: Sexp#grep_nodes_count

Defined in:
lib/code_analyzer/sexp.rb

#grep_nodes_count(options) ⇒ Integer

grep all the recursive child nodes with conditions, and get the count of match nodes.

Parameters:

  • options (Hash)

    grep conditions

Returns:

  • (Integer)

    the count of metch nodes



114
115
116
117
118
# File 'lib/code_analyzer/sexp.rb', line 114

def grep_nodes_count(options)
  count = 0
  grep_nodes(options) { |node| count += 1 }
  count
end