Method: Roar::JSON::JSONAPI::Document#to_hash

Defined in:
lib/roar/json/json_api/document.rb

#to_hash(options = {}) ⇒ Hash{String=>Object}

Render the document as a Ruby Hash

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • include (Array<#to_s>, #to_s, false)

    compound documents to include, specified as a list of relationship paths (Array or comma-separated String) or false, if no compound documents are to be included.

    N.B. this syntax and behaviour for this option is signficantly different to that of the include option implemented in other, non-JSON API Representers.

  • fields (Hash{Symbol=>[Array<String>]})

    fields to returned on a per-type basis.

  • meta (Hash{#to_s}=>Object)

    additional meta information to be rendered in the document.

  • user_options (Hash{Symbol=>Symbol})

    additional arbitary options to be passed to the Representer.

Returns:

  • (Hash{String=>Object})


53
54
55
# File 'lib/roar/json/json_api/document.rb', line 53

def to_hash(options = {})
  super
end