Sha256: 4ccce960656e054224d18f1e0295ad012ad69fcf2cdd1c6ef774765766dacae0
Contents?: true
Size: 426 Bytes
Versions: 1
Compression:
Stored size: 426 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.reject! {|k,v| v.nil?} end def to_SDF <<-EOS { "type": "#{type}", "id": "#{id}", "version": #{version}, "lang": "en", "fields": #{fields.to_json} } EOS end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
inquisitio-0.1.5 | lib/inquisitio/document.rb |