Class: JSONAPI::Home::V1::ResourceSerializer

Inherits:
Object
  • Object
show all
Includes:
Serializer
Defined in:
app/serializers/jsonapi/home/v1/resource_serializer.rb

Instance Method Summary collapse

Instance Method Details

#jsonapiObject



22
23
24
25
26
# File 'app/serializers/jsonapi/home/v1/resource_serializer.rb', line 22

def jsonapi
  {
    version: object.jsonapi_version
  }
end

#metaObject



28
29
30
31
32
33
34
35
36
37
38
# File 'app/serializers/jsonapi/home/v1/resource_serializer.rb', line 28

def meta
  [
    if object.documentation
      {
        documentation: {
          href: object.documentation
        }
      }
    end,
  ].compact.reduce(&:merge)
end

#typeObject



18
19
20
# File 'app/serializers/jsonapi/home/v1/resource_serializer.rb', line 18

def type
  "jsonapi-home-resources"
end