Sha256: 3a7123a953dd6ce2d3cd76bab7029a640ffec28903ea5281bd5c3c75d5e1e077

Contents?: true

Size: 615 Bytes

Versions: 1

Compression:

Stored size: 615 Bytes

Contents

# frozen_string_literal: true

module Typesense
  class Collection
    attr_reader :documents
    attr_reader :overrides

    def initialize(configuration, name)
      @configuration = configuration
      @name          = name
      @documents     = Documents.new(@configuration, @name)
      @overrides     = Overrides.new(@configuration, @name)
    end

    def retrieve
      ApiCall.new(@configuration).get(endpoint_path)
    end

    def delete
      ApiCall.new(@configuration).delete(endpoint_path)
    end

    private

    def endpoint_path
      "#{Collections::RESOURCE_PATH}/#{@name}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typesense-0.2.0 lib/typesense/collection.rb