aboutsummaryrefslogtreecommitdiff
path: root/src/serializers/base_serializer.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/serializers/base_serializer.cr')
-rw-r--r--src/serializers/base_serializer.cr7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/serializers/base_serializer.cr b/src/serializers/base_serializer.cr
new file mode 100644
index 0000000..3ad0a66
--- /dev/null
+++ b/src/serializers/base_serializer.cr
@@ -0,0 +1,7 @@
+abstract class BaseSerializer < Lucky::Serializer
+ def self.for_collection(collection : Enumerable, *args, **named_args)
+ collection.map do |object|
+ new(object, *args, **named_args)
+ end
+ end
+end