Sha256: f0656469a2b8c1fcebc997fa7313d40324c808afcc12286b0c8b4e873ca3facd

Contents?: true

Size: 346 Bytes

Versions: 7

Compression:

Stored size: 346 Bytes

Contents

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.
    def meta_def(name, &block)
      (class << self; self end).send(:define_method, name, &block)
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
sequel-3.12.1 lib/sequel/metaprogramming.rb
sequel-3.12.0 lib/sequel/metaprogramming.rb
sequel-3.11.0 lib/sequel/metaprogramming.rb
viking-sequel-3.10.0 lib/sequel/metaprogramming.rb
sequel-3.10.0 lib/sequel/metaprogramming.rb
sequel-3.9.0 lib/sequel/metaprogramming.rb
sequel-3.8.0 lib/sequel/metaprogramming.rb