Sha256: 9ee4f61eb33a0120bd932f9c67da96c465f6ddeb35d2c0d53c1ad09a25742a10
Contents?: true
Size: 394 Bytes
Versions: 8
Compression:
Stored size: 394 Bytes
Contents
module Kernel def calling_method caller[1][/`([^']*)'/, 1].to_sym end # Returns the object's singleton class (exists in Ruby 1.9.2) def singleton_class; class << self; self; end; end unless method_defined?(:singleton_class) # class_eval on an object acts like singleton_class.class_eval. def class_eval(*args, &block) singleton_class.class_eval(*args, &block) end end
Version data entries
8 entries across 8 versions & 1 rubygems