Sha256: 56d4c2894c38362d9dbaee702aad229a06dd2f0401e08a1f44237f9050232b0d

Contents?: true

Size: 856 Bytes

Versions: 1

Compression:

Stored size: 856 Bytes

Contents

require "radriar/api/authentication"
require "radriar/api/context"
require "radriar/api/exception_handling"
require "radriar/api/logging"
require "radriar/api/strong_parameters_support"

module Radriar
  module Grape
  end
end

class ::Grape::API
  def self.radriarize(hypermedia: false, representer_namespace: nil, translate_keys: false)
    class_eval do
      format :json
      default_format :json

      helpers Radriar::API::Authentication
      helpers Radriar::API::Logging
      helpers Radriar::API::Context
      helpers Radriar::API::StrongParametersSupport
      helpers Radriar::Roar::Representers

      Radriar::Representable.representer_namespace = representer_namespace
      Radriar::Representable.hypermedia = hypermedia

      include Radriar::Roar::KeyTranslation if translate_keys
      include Radriar::Roar::HAL
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radriar-0.1.0.alpha.1 lib/radriar/grape.rb