Sha256: e76aa347550b39f231bceac7a45f8b6534469ec447a091a53d1ae925c22c39c4
Contents?: true
Size: 830 Bytes
Versions: 2
Compression:
Stored size: 830 Bytes
Contents
module ApiTaster class Mapper class << self def get(path, params = {}) map_method(:get, path, params) end def post(path, params = {}) map_method(:post, path, params) end def put(path, params = {}) map_method(:put, path, params) end def delete(path, params = {}) map_method(:delete, path, params) end private def map_method(method, path, params) route = Route.find_by_verb_and_path(method, path) if route.nil? Route.obsolete_definitions << { :verb => method, :path => path, :params => params } else Route.supplied_params[route[:id]] ||= [] Route.supplied_params[route[:id]] << params end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
api_taster-0.4.6 | lib/api_taster/mapper.rb |
api_taster-0.4.5 | lib/api_taster/mapper.rb |