Module: Object::SingletonMethods

Included in:
Object
Defined in:
lib/vex/base/object/singleton_methods.rb

Instance Method Summary collapse

Instance Method Details

#define_object_method(name, &block) ⇒ Object

defines a method on an object



9
10
11
# File 'lib/vex/base/object/singleton_methods.rb', line 9

def define_object_method(name, &block)
  singleton_class.send :define_method, name, &block
end

#singleton_classObject

returns the singleton class of an object



4
5
6
# File 'lib/vex/base/object/singleton_methods.rb', line 4

def singleton_class
  class << self; self; end
end