Sha256: 8423e7dab10f6e51e333b272fbba9eb841e5301b97b9c8e81b371714becd80b8

Contents?: true

Size: 462 Bytes

Versions: 23

Compression:

Stored size: 462 Bytes

Contents

# frozen_string_literal: true

module Typesense
  class Collections
    RESOURCE_PATH = '/collections'

    def initialize(api_call)
      @api_call    = api_call
      @collections = {}
    end

    def create(schema)
      @api_call.post(RESOURCE_PATH, schema)
    end

    def retrieve
      @api_call.get(RESOURCE_PATH)
    end

    def [](collection_name)
      @collections[collection_name] ||= Collection.new(collection_name, @api_call)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
typesense-1.0.0 lib/typesense/collections.rb
typesense-0.15.0 lib/typesense/collections.rb
typesense-0.14.1 lib/typesense/collections.rb
typesense-0.14.0 lib/typesense/collections.rb
typesense-0.13.0 lib/typesense/collections.rb
typesense-0.12.0 lib/typesense/collections.rb
typesense-0.11.1 lib/typesense/collections.rb
typesense-0.11.0 lib/typesense/collections.rb
typesense-0.10.0 lib/typesense/collections.rb
typesense-0.9.0 lib/typesense/collections.rb
typesense-0.8.0 lib/typesense/collections.rb
typesense-0.8.0pre lib/typesense/collections.rb
typesense-0.7.0 lib/typesense/collections.rb
typesense-0.7.0.pre1 lib/typesense/collections.rb
typesense-0.7.0.pre0 lib/typesense/collections.rb
typesense-0.6.0 lib/typesense/collections.rb
typesense-0.5.5 lib/typesense/collections.rb
typesense-0.5.4 lib/typesense/collections.rb
typesense-0.5.3 lib/typesense/collections.rb
typesense-0.5.2 lib/typesense/collections.rb