Sha256: 969e5e67822b6b7b8f4e6bfff60e9505dd72b9ce42e15772d8c9c24fecde3200

Contents?: true

Size: 364 Bytes

Versions: 9

Compression:

Stored size: 364 Bytes

Contents

# frozen_string_literal: true

require_relative 'klass_factory'

# Defines a class factory that inherits from a class
# that includes ProtectedConstructor.
class KlassFactoryTwo < KlassFactory
  class << self
    def create(name, id)
      send(:new, name, id)
    end
  end

  attr_reader :name

  def initialize(name, id)
    super id
    @name = name
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ProtectedConstructor-3.0.3 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-3.0.2 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-3.0.1 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-3.0.0 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-2.1.6 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-2.1.5 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-2.1.4 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-2.1.3 spec/support/shared_klasses/klass_factory_two.rb
ProtectedConstructor-2.0.3 spec/support/shared_klasses/klass_factory_two.rb