Sha256: a7310f18fb979a9930a4b68086e510196b375ac8c0567c73fc869ed3dc79d806
Contents?: true
Size: 365 Bytes
Versions: 11
Compression:
Stored size: 365 Bytes
Contents
class Module def required(name, message=nil) message ||= "You need to implement method #{name}" define_method name do |*| raise message end end def patch(method_name, &block) method_proc = instance_method method_name define_method method_name do |*args| instance_exec(*args, method_proc.bind(self), &block) end end end
Version data entries
11 entries across 11 versions & 1 rubygems