Module: Sequel::Metaprogramming
- Defined in:
- lib/sequel/metaprogramming.rb
Overview
Contains meta_def method for adding methods to objects via blocks, used by some of Sequel’s classes and objects.
Instance Method Summary collapse
-
#meta_def(name, &block) ⇒ Object
Define a method with the given name and block body on the receiver.
Instance Method Details
#meta_def(name, &block) ⇒ Object
Define a method with the given name and block body on the receiver.
5 6 7 |
# File 'lib/sequel/metaprogramming.rb', line 5 def (name, &block) (class << self; self end).send(:define_method, name, &block) end |