Sha256: 647e2a5ad35d7fed6c8044b5c95a8cedca269844a6b7a80760365fca7d496ca7

Contents?: true

Size: 860 Bytes

Versions: 6

Compression:

Stored size: 860 Bytes

Contents

module InstDataShipper
  module DataSources
    module Base
      # This could be a Concern, but we don't want Concern inheritance logic kicking in if it is included into another Concern.

      def self.included(base)
        base.extend ActiveSupport::Concern unless self.is_a?(Class) || base < ActiveSupport::Concern
        base.extend ModuleHelperMethods
        base.send(:include, Concern)
      end

      module Concern
        extend ActiveSupport::Concern
      end

      module ModuleHelperMethods
        def delayed(mthd_sym)
          mthd = instance_method(mthd_sym)
          pmthd_sym = :"_delayed_#{mthd_sym}"

          alias_method pmthd_sym, mthd_sym
          private pmthd_sym

          define_method(mthd_sym) do |*args, **kwargs|
            delayed(pmthd_sym, *args, **kwargs)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
inst_data_shipper-0.2.6 lib/inst_data_shipper/data_sources/base.rb
inst_data_shipper-0.2.5 lib/inst_data_shipper/data_sources/base.rb
inst_data_shipper-0.2.4 lib/inst_data_shipper/data_sources/base.rb
inst_data_shipper-0.2.3 lib/inst_data_shipper/data_sources/base.rb
inst_data_shipper-0.2.2 lib/inst_data_shipper/data_sources/base.rb
inst_data_shipper-0.2.1 lib/inst_data_shipper/data_sources/base.rb