Sha256: 9d608699379123b2614f69d133fbdae805e01301f48166a698cc9fc83f9a3066

Contents?: true

Size: 259 Bytes

Versions: 4

Compression:

Stored size: 259 Bytes

Contents

# frozen_string_literal: true

class Module
  def virtual_method(*args)
    args.each do |method_name|
      define_method(method_name) do
        raise NotImplementedError, "#{self.class.name}##{method_name} is a virtual method!"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mtk_framework-1.0.1 lib/mtk_framework/core_extensions/module/virtual_method.rb
mtk_framework-1.0.0 lib/mtk_framework/core_extensions/module/virtual_method.rb
mtk_framework-0.1.7 lib/mtk_framework/core_extensions/module/virtual_method.rb
mtk_framework-0.1.6 lib/mtk_framework/core_extensions/module/virtual_method.rb