Sha256: 6fa566cad9c01bde06d0a6c9785097b06952c91994135b041fbfdd044f99c249
Contents?: true
Size: 876 Bytes
Versions: 5
Compression:
Stored size: 876 Bytes
Contents
require 'ostruct' require 'active_model' module ClusterPoint class Document < OpenStruct include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming extend ClusterPoint::FinderMethods extend ClusterPoint::HashMethods extend ClusterPoint::Contains extend ClusterPoint::ContainsMany include ClusterPoint::JsonMethods include ClusterPoint::ModificationMethods attr_accessor :id, :type def self.get_cp if @cp == nil @cp = ClusterPoint::ClusterPointAdapter.new end @cp end def get_cp if @cp == nil @cp = ClusterPoint::ClusterPointAdapter.new end @cp end def self.new_from_hash(hash) doc=self.from_hash(hash, self) doc["type"] = self.to_s.upcase doc end def persisted? id != nil end end end
Version data entries
5 entries across 5 versions & 1 rubygems