Sha256: 7aa403e299c3ed96cd60e3c67a6ced758592e1a8480e9fa154726ac9be3b3b8e

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

require 'simple_solr_client/schema/field_or_type'
class SimpleSolrClient::Schema
  class Field < Field_or_Type
    include Matcher

    attr_accessor :type_name, :type
    attr_reader :matcher


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

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

    # We can only resolve the actual type in the presence of a
    # particular schema
    def resolve_type(schema)
      self.type = schema.field_type(self.type_name)
      self
    end


    # When we reset the name, make sure to re-derive the matcher
    # object
    def name=(n)
      @name    = n
      @matcher = derive_matcher(n)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_solr_client-0.1.2 lib/simple_solr_client/schema/field.rb