Class: Inline::Ruby

Inherits:
C
  • Object
show all
Defined in:
lib/zenoptimize.rb

Instance Method Summary collapse

Instance Method Details

#optimize(meth) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/zenoptimize.rb', line 20

def optimize(meth)
  src = RubyToC.translate(@mod, meth)
  if $DEBUG then
    STDERR.puts
    STDERR.puts src
    STDERR.puts
  end
  @mod.class_eval "alias :#{meth}_slow :#{meth}"
  @mod.class_eval "remove_method :#{meth}"
  c src
end