Method: Ferret::Document::Field#reader_value

Defined in:
lib/ferret/document/field.rb

#reader_valueObject

Returns the string value of the data that is stored in this field



250
251
252
253
254
255
256
257
258
259
# File 'lib/ferret/document/field.rb', line 250

def reader_value
  if @data.respond_to? :read
    return @data
  elsif @data.instance_of? String
    return Ferret::Utils::StringHelper::StringReader.new(@data)
  else
    # if it is binary object try to return a string representation
    return Ferret::Utils::StringHelper::StringReader.new(@data.to_s)
  end
end