Sha256: 3551794fb8b140220217684360251850ec855fa42b56198c0ae61a4503653c8e
Contents?: true
Size: 406 Bytes
Versions: 39
Compression:
Stored size: 406 Bytes
Contents
require 'orange-core/resource' module Orange class RoutableResource < Resource def routable; true; end def route(path, packet) parts = path.split('/') first = parts[0].respond_to?(:to_sym) ? parts.shift.to_sym : :index new_path = parts.join('/') if self.respond_to?(first) packet[:content] = self.__send__(first, new_path, packet) end end end end
Version data entries
39 entries across 39 versions & 2 rubygems