Class: Restfulie::Server::ActionController::ParamsParser

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

Class Method Summary collapse

Class Method Details

.rails3?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/restfulie/server/action_controller/params_parser.rb', line 36

def self.rails3?
  defined?(::ActionDispatch) && defined?(::ActionDispatch::ParamsParser)
end

.register(content_type, representation) ⇒ Object

:singleton-method: Use it to register param parsers on the server side.

  • media type

  • a restfulie representation with to_hash method

    Restfulie::Server::ActionController::ParamsParser.register(‘application/atom+xml’, Atom)



80
81
82
# File 'lib/restfulie/server/action_controller/params_parser.rb', line 80

def self.register(content_type, representation)
  @parser.register(content_type, representation)
end

.unregister(content_type) ⇒ Object

:singleton-method: Use it to unregister param parsers on the server side.

  • media type

    Restfulie::Server::ActionController::ParamsParser.unregister(‘application/atom+xml’)



92
93
94
# File 'lib/restfulie/server/action_controller/params_parser.rb', line 92

def self.unregister(content_type)
  @parser.unregister(content_type)
end