Class: CoffeeTrace::InsertLogStatement

Inherits:
Object
  • Object
show all
Defined in:
lib/coffee_trace/insert_log_statement.rb

Instance Method Summary collapse

Instance Method Details

#for(line, prefix = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/coffee_trace/insert_log_statement.rb', line 3

def for line, prefix=nil
  leading_spaces, method_name, args = parse_function line
  return unless leading_spaces
  method_name = (prefix + "-" + method_name) if prefix 
  result = "#{leading_spaces}  console.log '#{method_name}'"
  result += ", #{args}" if args 
  result += " #coffee_trace"
  result 
end