def self.wrap_methods(c, opts={})
$methods_cache_dir = opts[:cache_dir]
$scenario_prefix = nil
c.class_eval do
cached_methods.each do |m|
next if c.instance_methods(false).include?("original_#{m}")
alias_method "original_#{m}".to_sym, m.to_sym
define_method m.to_sym do |*args|
args = args.first if args.size.eql?(1) and not args.first.class.eql?(Array)
output = deserialize_data(m, args)
unless output
output = method("original_#{m}".to_sym).to_proc[args]
return serialize_data(m, args, output)
else
return output
end
end
end
end
end