class Shaf::Serializer

A base class used for serializing objects into a HAL representations.

Attributes

default_curie_prefix[R]

Public Class Methods

profile(name, curie_prefix: :doc) click to toggle source

Creates a link with rel profile and href pointing to the corresponding profile. It also adds a Curie link. @param name [String] the name of the profile @param curie_prefix [Symbol] the prefix used for the Curie

Calls superclass method
# File lib/shaf/serializer.rb, line 18
def profile(name, curie_prefix: :doc)
  profile = Profiles.find name

  super { profile&.urn || profile_uri(name) }

  link :profile do
    profile_uri(name)
  end

  curie curie_prefix do
    doc_curie_uri(name)
  end

  @default_curie_prefix = curie_prefix.to_sym
end