Sha256: d800972f21a7c1b966fa41fd909e0fb8a4ac75e970de1698af23e09a4466ea6c
Contents?: true
Size: 552 Bytes
Versions: 24
Compression:
Stored size: 552 Bytes
Contents
# frozen_string_literal: true module Typesense class Aliases RESOURCE_PATH = '/aliases' def initialize(api_call) @api_call = api_call @aliases = {} end def upsert(alias_name, mapping) @api_call.put(endpoint_path(alias_name), mapping) end def retrieve @api_call.get(RESOURCE_PATH) end def [](alias_name) @aliases[alias_name] ||= Alias.new(alias_name, @api_call) end private def endpoint_path(alias_name) "#{Aliases::RESOURCE_PATH}/#{alias_name}" end end end
Version data entries
24 entries across 24 versions & 1 rubygems