Class: SandiMeter::MethodArgumentsCounter

Inherits:
Object
  • Object
show all
Defined in:
lib/sandi_meter/method_arguments_counter.rb

Instance Method Summary collapse

Constructor Details

#initializeMethodArgumentsCounter

Returns a new instance of MethodArgumentsCounter.


3
4
5
# File 'lib/sandi_meter/method_arguments_counter.rb', line 3

def initialize
  reset!
end

Instance Method Details

#count(args_add_block_sexp) ⇒ Object


7
8
9
10
11
12
13
14
15
# File 'lib/sandi_meter/method_arguments_counter.rb', line 7

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

#reset!Object


17
18
19
20
# File 'lib/sandi_meter/method_arguments_counter.rb', line 17

def reset!
  @count = 0
  @lines = []
end