lib/nephos-server/routing/load.rb in nephos-server-0.1.7 vs lib/nephos-server/routing/load.rb in nephos-server-0.1.8

- old
+ new

@@ -1,11 +1,5 @@ -class RoutingError < StandardError; end -class InvalidRoute < RoutingError; end -class InvalidRouteUrl < InvalidRoute; end -class InvalidRouteController < InvalidRoute; end -class InvalidRouteMethod < InvalidRoute; end - module Nephos module Route def self.add(what, verb) Nephos::Route::ALL << what.merge(verb: verb) @@ -35,26 +29,26 @@ def route_prefix @route_prefix ||= [] File.join(["/"] + @route_prefix) end -# @params what [Hash] +# @param what [Hash] def get what raise InvalidRoute unless what.is_a? Hash what[:url] = File.expand_path File.join(route_prefix, what[:url]) Nephos::Route.check!(what) Nephos::Route.add(what, "GET") end -# @params what [Hash] +# @param what [Hash] def post what raise InvalidRoute unless what.is_a? Hash what[:url] = File.join(route_prefix, what[:url]) Nephos::Route.check!(what) Nephos::Route.add(what, "POST") end -# @params what [Hash] +# @param what [Hash] def put what raise InvalidRoute unless what.is_a? Hash what[:url] = File.join(route_prefix, what[:url]) Nephos::Route.check!(what) Nephos::Route.add(what, "PUT")