Class: Yaks::Format::Hal

Inherits:
Yaks::Format show all
Defined in:
lib/yaks/format/hal.rb

Overview

Hypertext Application Language (stateless.co/hal_specification.html)

A lightweight JSON Hypermedia message format.

Options: :plural_links In HAL, a single rel can correspond to a single link, or to a list of links. Which rels are singular and which are plural is application-dependant. Yaks assumes all links are singular. If your resource might contain multiple links for the same rel, then configure that rel to be plural. In that case it will always be rendered as a collection, even when the resource only contains a single link.

Examples:


yaks = Yaks.new do
  format_options :hal, {plural_links: [:related_content]}
end

Direct Known Subclasses

Halo

Instance Attribute Summary

Attributes inherited from Yaks::Format

#env

Instance Method Summary collapse

Methods inherited from Yaks::Format

all, by_accept_header, by_media_type, by_name, #call, #initialize, media_types, names, register

Methods included from Util::Deprecated

#deprecated_alias

Methods included from Util

#Resolve, #camelize, #extract_options, #reject_keys, #slice_hash, #symbolize_keys, #underscore

Methods included from Yaks::FP::Callable

#to_proc

Constructor Details

This class inherits a constructor from Yaks::Format

Instance Method Details

#inverseObject



28
29
30
# File 'lib/yaks/format/hal.rb', line 28

def inverse
  Yaks::Reader::Hal.new
end

#transitive?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/yaks/format/hal.rb', line 24

def transitive?
  true
end