lib/koine/attributes/attributes_factory.rb in koine-attributes-1.2.3 vs lib/koine/attributes/attributes_factory.rb in koine-attributes-1.2.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Koine
module Attributes
class AttributesFactory
def initialize(options = {})
@adapters = {}
@@ -17,9 +19,10 @@
@adapters[name.to_sym] = adapter.freeze
end
def coerce_adapter(adapter)
return adapter unless adapter.instance_of?(::Symbol)
+
Object.const_get("Koine::Attributes::Adapter::#{adapter.to_s.capitalize}").new
end
def freeze
super