Sha256: 8e39b8450e6e78e828c155dcd2115bd60bd1efa42beb39919b115cdb7daf836e

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

module Indexes
  class Configuration

    attr_accessor :hosts, :log, :trace

    def computed_sorts
      @computed_sorts ||= {}
    end

    def mappings(&block)
      if block_given?
        @mappings = Dsl::Mappings.new(&block).to_h
      else
        @mappings
      end
    end

    def analysis(&block)
      if block_given?
        @analysis = { analysis: Dsl::Api.new(&block).to_h }
      else
        @analysis
      end
    end

    def suggestions(&block)
      if block_given?
        @suggestions = block
      else
        @suggestions
      end
    end

    def computed_sort(name, &block)
      self.computed_sorts[name] = block
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
indexes-4.0.0.2 lib/indexes/configuration.rb
indexes-4.0.0.1 lib/indexes/configuration.rb
indexes-4.0.0.0 lib/indexes/configuration.rb