Sha256: 814ccfcdecddfdac1d1368c67d505665eb6035f55b80f43d18b0d9dc3a898c81

Contents?: true

Size: 819 Bytes

Versions: 160

Compression:

Stored size: 819 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/common_constructor/instance_initialize'
require 'eac_ruby_utils/common_constructor/super_args'

module EacRubyUtils
  class CommonConstructor
    class ClassInitialize
      attr_reader :common_constructor, :klass

      def initialize(common_constructor, klass)
        @common_constructor = common_constructor
        @klass = klass
      end

      def run
        class_initialize = self
        klass.send(:define_method, :initialize) do |*args|
          ::EacRubyUtils::CommonConstructor::InstanceInitialize.new(
            class_initialize.common_constructor, args, self
          ).run
          super(*::EacRubyUtils::CommonConstructor::SuperArgs.new(
            class_initialize, args, self
          ).result)
        end
      end
    end
  end
end

Version data entries

160 entries across 160 versions & 4 rubygems

Version Path
eac_tools-0.24.1 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_ruby_utils-0.100.0 lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.24.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_ruby_utils-0.99.0 lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.23.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.22.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.21.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.20.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.19.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.18.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.17.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.16.1 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_ruby_utils-0.98.0 lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.16.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.15.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.14.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_ruby_utils-0.97.0 lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.13.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_ruby_utils-0.96.1 lib/eac_ruby_utils/common_constructor/class_initialize.rb
eac_tools-0.12.0 sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb