Sha256: cb57462389d0bc863ff779caadb02b9e7ed601ae10f679df22c4d087e7ba7981

Contents?: true

Size: 293 Bytes

Versions: 2

Compression:

Stored size: 293 Bytes

Contents

require 'industrialist/registrar'

module Industrialist
  class Builder
    def self.build(type, key, *args)
      klass = Registrar.value_for(type, key)
      Object.const_get(klass.name)&.new(*args) unless klass.nil?
    end
  end

  def self.build(*args)
    Builder.build(*args)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
industrialist-1.0.1 lib/industrialist/builder.rb
industrialist-1.0.0 lib/industrialist/builder.rb