lib/koine/attributes/attributes.rb in koine-attributes-1.2.3 vs lib/koine/attributes/attributes.rb in koine-attributes-1.2.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Koine
module Attributes
class Attributes
def initialize(object, adapters:, options: {})
@object = object
@@ -16,9 +18,10 @@
if !@initializer[:initialize] && !values.empty?
raise InvalidAttributesError, "wrong number of arguments (given #{values.length}, expected 0)"
end
return unless @initializer[:initialize]
+
set_values(values) && @initializer[:freeze] && freeze
end
def set_values(values)
invalid_attributes = []