Sha256: 04b2b915994a55102a824cc3777bfadc95cb7bc5400bfcb0d88a3b89fee8e08d

Contents?: true

Size: 403 Bytes

Versions: 8

Compression:

Stored size: 403 Bytes

Contents

require 'json'
module Inquisitio
  class Document

    attr_reader :type, :id, :version, :fields
    def initialize(type, id, version, fields)
      @type = type
      @id = id
      @version = version
      @fields = fields
    end

    def to_SDF
      <<-EOS
{ "type": "#{type}",
  "id":   "#{id}",
  "version": #{version},
  "lang": "en",
  "fields": #{fields.to_json}
}
      EOS
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inquisitio-0.1.4 lib/inquisitio/document.rb
inquisitio-0.1.3 lib/inquisitio/document.rb
inquisitio-0.1.2 lib/inquisitio/document.rb
inquisitio-0.1.1 lib/inquisitio/document.rb
inquisitio-0.1.0 lib/inquisitio/document.rb
inquisitio-0.0.13 lib/inquisitio/document.rb
inquisitio-0.0.12 lib/inquisitio/document.rb
inquisitio-0.0.11 lib/inquisitio/document.rb