/usr/lib/ruby/vendor_ruby/sequel/metaprogramming.rb is in ruby-sequel 3.33.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 | module Sequel
# Contains meta_def method for adding methods to objects via blocks, used by some of Sequel's classes and objects.
module Metaprogramming
# Define a method with the given name and block body on the receiver.
#
# ds = DB[:items]
# ds.meta_def(:x){42}
# ds.x # => 42
def meta_def(name, &block)
(class << self; self end).send(:define_method, name, &block)
end
end
end
|