Class: Api::V2::LotTypeResource

Inherits:
BaseResource
  • Object
show all
Defined in:
app/resources/api/v2/lot_type_resource.rb

Overview

Provides a JSON API representation of LotType See: jsonapi-resources.com/ for JSONAPI::Resource documentation

Instance Method Summary collapse

Methods inherited from BaseResource

apply_includes, default_includes, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Method Details

#template_typeObject

Our internal class names don't make much sense via the API, so we expose the corresponding resource type instead.


32
33
34
35
# File 'app/resources/api/v2/lot_type_resource.rb', line 32

def template_type
  template_type = _model.template_class.underscore
  self.class._model_hints[template_type] || template_type
end