Sha256: 9698a9aa84431425fb71d12801d545abe62125802d8bc56776e93fdaf30eb2b5
Contents?: true
Size: 749 Bytes
Versions: 16
Compression:
Stored size: 749 Bytes
Contents
module SandiMeter class MethodArgumentsCounter def initialize reset! end def count(args_add_block_sexp) reset! @count += args_add_block_sexp[1].size @count += 1 if args_add_block_sexp.last == true bypass_sexp(args_add_block_sexp) return [@count, @lines.uniq.sort.first] end def reset! @count = 0 @lines = [] end private def bypass_sexp(args_add_block_sexp) args_add_block_sexp.each do |sexp| next unless sexp.kind_of?(Array) case sexp.first when :bare_assoc_hash @count += sexp[1].size - 1 when :@int, :@ident @lines << sexp.last.first end bypass_sexp(sexp) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems