class Stretch::URIBuilder

Public Class Methods

build_from_scope(scope, path) click to toggle source
# File lib/stretch/uri_builder.rb, line 3
def self.build_from_scope scope, path
  path.gsub!(/\A\//, '')

  if scope[:cluster]
    "/_cluster/#{path}"
  elsif scope[:index]
    "/#{scope[:index]}/#{path}"
  end
end