Sha256: e63f2d642b94c9b4536339a963614420016ac3034bcfccc9b5d363f350c84848

Contents?: true

Size: 420 Bytes

Versions: 19

Compression:

Stored size: 420 Bytes

Contents

module Elastic::Types
  module FacetedType
    def fields(*_fields)
      raise ArgumentError, 'must provide at least a field name' if _fields.empty?

      options = {}
      options = _fields.pop if _fields.last.is_a? Hash

      _fields.each { |name| field(name, options) }
    end

    def field(_name, _options = {})
      pre_definition.register_field Elastic::Fields::Value.new(_name, _options)
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
elastic-rails-1.0.4 lib/elastic/types/faceted_type.rb
elastic-rails-1.0.3 lib/elastic/types/faceted_type.rb
elastic-rails-1.0.2 lib/elastic/types/faceted_type.rb
elastic-rails-1.0.1 lib/elastic/types/faceted_type.rb
elastic-rails-1.0.0 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.7 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.6 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.5 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.4 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.3 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.2 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.1 lib/elastic/types/faceted_type.rb
elastic-rails-0.8.0 lib/elastic/types/faceted_type.rb
elastic-rails-0.7.0 lib/elastic/types/faceted_type.rb
elastic-rails-0.6.4 lib/elastic/types/faceted_type.rb
elastic-rails-0.6.3 lib/elastic/types/faceted_type.rb
elastic-rails-0.6.2 lib/elastic/types/faceted_type.rb
elastic-rails-0.6.1 lib/elastic/types/faceted_type.rb
elastic-rails-0.6.0 lib/elastic/types/faceted_type.rb