Class: Api::V2::TagGroupResource

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

Overview

Provides a JSON API representation of TagGroup 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

#tagsObject

Class method overrides We inline tags to better isolate our implementation


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

def tags
  _model.tags.sort_by(&:map_id).map do |tag|
    { index: tag.map_id, oligo: tag.oligo }
  end
end