Sha256: 67b0bbb4e75ae7deced95c6657f2f04bdbb24dcd06fca676bcb1a0b8cad7b4e2

Contents?: true

Size: 383 Bytes

Versions: 19

Compression:

Stored size: 383 Bytes

Contents

module VvmRb
  module Base
    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods
      def before_method(*names)
        names.each do |name|
          m = instance_method(name)
          define_method(name) do |*args, &block|
            yield
            m.bind(self).call(*args, &block)
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
vvm-rb-0.2.2 lib/vvm-rb/base.rb
vvm-rb-0.2.1 lib/vvm-rb/base.rb
vvm-rb-0.2.0 lib/vvm-rb/base.rb
vvm-rb-0.1.6 lib/vvm-rb/base.rb
vvm-rb-0.1.5 lib/vvm-rb/base.rb
vvm-rb-0.1.4 lib/vvm-rb/base.rb
vvm-rb-0.1.3 lib/vvm-rb/base.rb
vvm-rb-0.1.2 lib/vvm-rb/base.rb
vvm-rb-0.1.1 lib/vvm-rb/base.rb
vvm-rb-0.1.0 lib/vvm-rb/base.rb
vvm-rb-0.0.15 lib/vvm-rb/base.rb
vvm-rb-0.0.14 lib/vvm-rb/base.rb
vvm-rb-0.0.13 lib/vvm-rb/base.rb
vvm-rb-0.0.12 lib/vvm-rb/base.rb
vvm-rb-0.0.11 lib/vvm-rb/base.rb
vvm-rb-0.0.10 lib/vvm-rb/base.rb
vvm-rb-0.0.9 lib/vvm-rb/base.rb
vvm-rb-0.0.8 lib/vvm-rb/base.rb
vvm-rb-0.0.7 lib/vvm-rb/base.rb