Sha256: 0323c9834f18aeefc29f01376e55030a33faa9410f2ca5456876b0441bce46bd

Contents?: true

Size: 278 Bytes

Versions: 9

Compression:

Stored size: 278 Bytes

Contents

# frozen_string_literal: true

# Defines a class factory that includes ProtectedConstructor.
class KlassFactory
  include ProtectedConstructor

  class << self
    def create(id)
      send(:new, id)
    end
  end

  attr_reader :id

  def initialize(id)
    @id = id
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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