0.0
No commit activity in last 3 years
No release in over 3 years
Useful for callbacks, benchmarking, profiling, code graphs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.8.3
>= 0
~> 3.12
 Project Readme

wrap_method¶ ↑

Useful for callbacks, benchmarking, profiling, code graphs.

Example¶ ↑

require 'rubygems'
require 'wrap_method'

class Module
  def make_cool(method_name)
    wrap_method(method_name) do |org_method, args, block|
      puts 'Pssst!'
      result = org_method.call(*args, &block)
      puts '     Sexy girl!!!'
      result
    end
  end
end

class Person
  def greet
    puts '  Hey there..'
  end
end

Person.make_cool :greet
Person.new.greet

Output¶ ↑

Pssst!
  Hey there..
     Sexy girl!!!

I am not the author, am just providing people with the gem. original code and author can be found here:

www.erikveen.dds.nl/monitorfunctions/index.html