Class: ForestLiana::SchemaSerializer

Inherits:
Object
  • Object
show all
Defined in:
app/serializers/forest_liana/schema_serializer.rb

Instance Method Summary collapse

Constructor Details

#initialize(collections, meta) ⇒ SchemaSerializer

Returns a new instance of SchemaSerializer.


2
3
4
5
6
7
# File 'app/serializers/forest_liana/schema_serializer.rb', line 2

def initialize collections, meta
  @collections = collections
  @meta = meta
  @data = []
  @included = []
end

Instance Method Details

#serializeObject


9
10
11
12
13
14
15
16
# File 'app/serializers/forest_liana/schema_serializer.rb', line 9

def serialize
  populate_data_and_included
  {
    data: @data,
    included: @included,
    meta: @meta
  }
end