module Ruhoh::Base::Routable

Makes a collection routable.

Public Instance Methods

routes() click to toggle source
# File lib/ruhoh/base/routable.rb, line 3
def routes
  return @routes if @routes
  @routes = {}
  dictionary
  @routes
end
routes_add(route, pointer) click to toggle source
# File lib/ruhoh/base/routable.rb, line 10
def routes_add(route, pointer)
  @routes ||= {}
  @routes[route] = pointer
end
routes_delete(pointer) click to toggle source
# File lib/ruhoh/base/routable.rb, line 15
def routes_delete(pointer)
  return unless @routes
  route = @routes.find{ |k, v| v == pointer }
  @routes.delete(route[0]) if route
end