Class: ScopedSerializer::CollectionSerializer
- Inherits:
-
ArraySerializer
- Object
- BaseSerializer
- ArraySerializer
- ScopedSerializer::CollectionSerializer
- Defined in:
- lib/scoped_serializer/collection_serializer.rb
Instance Attribute Summary
Attributes inherited from ArraySerializer
#array, #options, #scope, #scope_name
Instance Method Summary collapse
-
#initialize(*args) ⇒ CollectionSerializer
constructor
A new instance of CollectionSerializer.
Methods inherited from ArraySerializer
Methods inherited from BaseSerializer
#as_json, #default_root_key, #meta, #meta_hash, #set_scope
Constructor Details
#initialize(*args) ⇒ CollectionSerializer
Returns a new instance of CollectionSerializer.
4 5 6 7 8 9 |
# File 'lib/scoped_serializer/collection_serializer.rb', line 4 def initialize(*args) super # Configure root element @options[:root] = default_root_key(@array.klass).pluralize if @options[:root].nil? end |