class Ravanello::Resolver

Resolves redis key to the endpoint

Attributes

router[R]

Public Class Methods

new(router, options = {}) click to toggle source
# File lib/ravanello/resolver.rb, line 8
def initialize(router, options = {})
  @router = router
  @separator = options.fetch(:separator, ':')
end

Public Instance Methods

call(path) click to toggle source
# File lib/ravanello/resolver.rb, line 13
def call(path)
  path_parts = path.split(@separator)
  resolved = NodeResolver.new(router.root, *path_parts).call

  raise Error, "Error resolving #{path}" if resolved.nil?

  resolved
end