lib/inquisitio/document.rb in inquisitio-1.5.0 vs lib/inquisitio/document.rb in inquisitio-2.0.0

- old
+ new

@@ -6,17 +6,13 @@ def initialize(type, id, version, fields) @type = type @id = id @version = version - @fields = fields.reject { |k, v| v.nil? } + @fields = fields.reject { |_, v| v.nil? } end - def to_SDF - if Inquisitio.config.api_version == '2011-02-01' - "{ \"type\": \"#{type}\", \"id\": \"#{id}\", \"version\": #{version}, \"lang\": \"en\", \"fields\": #{fields.to_json} }" - elsif Inquisitio.config.api_version == '2013-01-01' - "{ \"type\": \"#{type}\", \"id\": \"#{id}\", \"fields\": #{fields.to_json} }" - end + def to_sdf + "{ \"type\": \"#{type}\", \"id\": \"#{id}\", \"fields\": #{fields.to_json} }" end end end