module Roar::JSON::JSONAPI

Constants

VERSION

Public Class Methods

resource(type, options = {}) click to toggle source

Include to define a JSON API Resource and make API methods available to your `Roar::Decorator`.

@example Basic Usage

class SongsRepresenter < Roar::Decorator
  include Roar::JSON::JSONAPI.resource :songs
end

@example Custom ID key

class SongsRepresenter < Roar::Decorator
  include Roar::JSON::JSONAPI.resource :songs, id_key: :song_id
end

@param (see Resource.initialize) @option options (see Resource.initialize)

@see Mixin @api public

# File lib/roar/json/json_api.rb, line 70
def self.resource(type, options = {})
  Resource.new(type, options)
end