Sha256: 837cb4a147f7f2580de1c500e888a5e76f056b3932d10e1682984846c834b2c6

Contents?: true

Size: 610 Bytes

Versions: 3

Compression:

Stored size: 610 Bytes

Contents

# Unify the Ruby APIs across versions
#

# src : https://github.com/marcandre/backports/blob/master/lib/backports/1.9.1/kernel/define_singleton_method.rb
unless Kernel.method_defined? :define_singleton_method
  module Kernel
    def define_singleton_method(*args, &block)
      class << self
        self
      end.send(:define_method, *args, &block)
    end
  end
end

# src: https://github.com/marcandre/backports/blob/master/lib/backports/1.9.2/kernel/singleton_class.rb
unless Kernel.method_defined? :singleton_class
  module Kernel
    def singleton_class
      class << self; self; end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
private_please-0.0.5 lib/private_please/ruby_backports.rb
private_please-0.0.4 lib/private_please/ruby_backports.rb
private_please-0.0.3 lib/private_please/ruby_backports.rb