Sha256: 038b4a2881b7dccf1049dfe22314043d94879f038d95e8f3bd38a85fe3c750c9

Contents?: true

Size: 306 Bytes

Versions: 145

Compression:

Stored size: 306 Bytes

Contents

class Object
  # Returns the object's singleton class.
  def singleton_class
    class << self
      self
    end
  end unless respond_to?(:singleton_class)

  # class_eval on an object acts like singleton_class_eval.
  def class_eval(*args, &block)
    singleton_class.class_eval(*args, &block)
  end
end

Version data entries

145 entries across 115 versions & 9 rubygems

Version Path
fake_arel-1.5.1 lib/fake_arel/singleton_class.rb
depengine-0.0.31 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.31 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.30 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.29 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.28 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.27 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.26 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.25 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.24 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.24 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.23 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.23 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb
depengine-0.0.22 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/object/singleton_class.rb