Class: Restfulie::Server::ActionController::ParamsParser3

Inherits:
Object
  • Object
show all
Defined in:
lib/restfulie/server/action_controller/params_parser.rb

Overview

This class is just a proxy for the extension point offered by ActionDispatch::ParamsParser

Instance Method Summary collapse

Instance Method Details

#register(content_type, representation) ⇒ Object



8
9
10
# File 'lib/restfulie/server/action_controller/params_parser.rb', line 8

def register(content_type, representation)
  ActionDispatch::ParamsParser::DEFAULT_PARSERS[Mime::Type.lookup(content_type)] = representation.method(:to_hash).to_proc
end

#unregister(content_type) ⇒ Object



12
13
14
# File 'lib/restfulie/server/action_controller/params_parser.rb', line 12

def unregister(content_type)
  ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::Type.lookup(content_type))
end