Module: CoreEx::Object::SingletonClass

Included in:
Object
Defined in:
lib/core_ex/object/singleton_class.rb

Instance Method Summary collapse

Instance Method Details

#singleton_classObject



13
14
15
16
17
# File 'lib/core_ex/object/singleton_class.rb', line 13

def singleton_class
  class << self
    self
  end
end

#singleton_class_eval(*args, &block) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/core_ex/object/singleton_class.rb', line 29

def singleton_class_eval ( *args, &block )
  if block.nil? or args.empty?
    singleton_class.class_eval(*args, &block)
  else
    singleton_class.instance_eval(*args, &block)
  end
end