Sha256: 87112f719aedda2b858534aeb61596fb05487fe57013e62897f23144c1e9bcef
Contents?: true
Size: 703 Bytes
Versions: 27
Compression:
Stored size: 703 Bytes
Contents
require "document/attribute_initializer/base" require "document/attribute_initializer/active_model" require "document/attribute_initializer/enum" module Document module AttributeInitializer def self.determine_initializer(klass, name, type, options) initializer_class = build_class(type) initializer_class.new(klass, name, type, options) end def self.build_class(type) case when type == Document::Enum AttributeInitializer::Enum when type && type.included_modules.include?(::ActiveModel::Model) AttributeInitializer::ActiveModel else AttributeInitializer::Base end end private_class_method :build_class end end
Version data entries
27 entries across 27 versions & 1 rubygems