Module: Kernel

Defined in:
lib/rpc_mapper/core_ext/kernel/singleton_class.rb

Overview

TRP: Copied from Rails 3RC1 on 8/17/2010 (not available in Rails2)

Instance Method Summary collapse

Instance Method Details

#class_eval(*args, &block) ⇒ Object

class_eval on an object acts like singleton_class.class_eval.



11
12
13
# File 'lib/rpc_mapper/core_ext/kernel/singleton_class.rb', line 11

def class_eval(*args, &block)
  singleton_class.class_eval(*args, &block)
end

#singleton_classObject

Returns the object’s singleton class.



4
5
6
7
8
# File 'lib/rpc_mapper/core_ext/kernel/singleton_class.rb', line 4

def singleton_class
  class << self
    self
  end
end