lib/hanami/model/sql/entity/schema.rb in hanami-model-1.0.0 vs lib/hanami/model/sql/entity/schema.rb in hanami-model-1.0.1
- old
+ new
@@ -36,9 +36,25 @@
@schema = Types::Coercible::Hash.schema(attributes)
@attributes = Hash[attributes.map { |k, _| [k, true] }]
freeze
end
+ # Process attributes
+ #
+ # @param attributes [#to_hash] the attributes hash
+ #
+ # @raise [TypeError] if the process fails
+ #
+ # @since 1.0.1
+ # @api private
+ def call(attributes)
+ schema.call(attributes)
+ end
+
+ # @since 1.0.1
+ # @api private
+ alias [] call
+
# Check if the attribute is known
#
# @param name [Symbol] the attribute name
#
# @return [TrueClass,FalseClass] the result of the check