Sha256: cdf8c32f1f3851c6d6d3d77e7b375a5e249b6b919a6ca752408de68aa705cf47

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

require 'simple_solr/schema/field'
class SimpleSolrClient::Schema
  class DynamicField < Field

    def initialize(*args)
      super
      @dynamic = true
    end

    def xml_node(doc)
      Nokogiri::XML::Element.new('dynamicField', doc)
    end

    # What name will we get from a matching thing?
    def dynamic_name(s)
      m = @matcher.match(s)
      if m
        m[1] << m[2]
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_solr_client-0.1.1 lib/simple_solr/schema/dynamic_field.rb
simple_solr_client-0.1.0 lib/simple_solr/schema/dynamic_field.rb