Sha256: 795adbd5f0e714dd5b5a1399980e622adc940399ebcf1aff9b1b754885426122

Contents?: true

Size: 440 Bytes

Versions: 2

Compression:

Stored size: 440 Bytes

Contents

require 'industrialist/registrar'
require 'industrialist/type'

module Industrialist
  module Manufacturable
    def self.extended(base)
      base.class_variable_set(:@@type, Type.industrialize(base))
    end

    def corresponds_to(key)
      Registrar.register(self.class_variable_get(:@@type), key, self)
    end

    def manufacturable_default
      Registrar.register_default(self.class_variable_get(:@@type), self)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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