Sha256: 8003f374cdf564e7796e5befdc2721b05482c32738e0323b50d0718c78f75481

Contents?: true

Size: 358 Bytes

Versions: 23

Compression:

Stored size: 358 Bytes

Contents

# frozen_string_literal: true

module Typesense
  class Key
    def initialize(id, api_call)
      @id = id
      @api_call = api_call
    end

    def retrieve
      @api_call.get(endpoint_path)
    end

    def delete
      @api_call.delete(endpoint_path)
    end

    private

    def endpoint_path
      "#{Keys::RESOURCE_PATH}/#{@id}"
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
typesense-0.5.2 lib/typesense/key.rb
typesense-0.5.1 lib/typesense/key.rb
typesense-0.5.0 lib/typesense/key.rb