lib/koine/attributes/attributes.rb in koine-attributes-1.1.0 vs lib/koine/attributes/attributes.rb in koine-attributes-1.2.0
- old
+ new
@@ -12,11 +12,11 @@
end
end
def initialize_values(values = {})
if !@initializer[:initialize] && !values.empty?
- raise ArgumentError, "wrong number of arguments (given #{values.length}, expected 0)"
+ raise InvalidAttributesError, "wrong number of arguments (given #{values.length}, expected 0)"
end
return unless @initializer[:initialize]
set_values(values) && @initializer[:freeze] && freeze
end
@@ -28,10 +28,10 @@
attributes = values.keys.map(&:to_sym)
invalid_attributes = attributes - valid_attributes
end
unless invalid_attributes.empty?
- raise ArgumentError, "Invalid attributes (#{invalid_attributes.join(', ')})"
+ raise InvalidAttributesError, "Invalid attributes (#{invalid_attributes.join(', ')})"
end
values.each do |attribute, value|
set(attribute, value) if has_attribute?(attribute)
end