lib/schema_serializer/serializable.rb in schema_serializer-0.2.0 vs lib/schema_serializer/serializable.rb in schema_serializer-0.2.1
- old
+ new
@@ -1,7 +1,9 @@
class SchemaSerializer
module Serializable
- def serializer(klass = nil)
+ def serializer(*args)
+ options = args.last.is_a?(Hash) ? args.pop : {}
+ klass = args.first || options[:class]
(klass || "#{self.class.name}Serializer".safe_constantize || SchemaSerializer).new(self)
end
end
end