yamotech/activerecord-dbt

View on GitHub
lib/active_record/dbt/required_methods.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module ActiveRecord
  module Dbt
    module RequiredMethods
      def define_required_methods(*methods)
        methods.each do |method_name|
          define_method(method_name) do
            raise RequiredImplementationMissingError, "You must implement #{self.class}##{__method__}"
          end
        end
      end

      class RequiredImplementationMissingError < StandardError; end
    end
  end
end