Class: Object

Inherits:
BasicObject
Defined in:
lib/sitefuel/extensions/DynamicClassMethods.rb

Overview

File

DynamicClassMethods.rb

Author

wkm

Copyright

2009, Zanoccio LLC.

License

GPL version 2.0 (see LICENSE.rb)

Adds a #meta_def function to Object so we can programmatically define class methods.

Instance Method Summary (collapse)

Instance Method Details

- (Object) define_class_method(name, &blk)



16
17
18
# File 'lib/sitefuel/extensions/DynamicClassMethods.rb', line 16

def define_class_method name, &blk
  (class << self; self; end).instance_eval { define_method name, &blk}
end