class OrientdbBinary::Protocols::RecordLoadAnswer

Public Instance Methods

process(options) click to toggle source
# File lib/orientdb_binary/protocols/record_load.rb, line 40
def process(options)
  colls = self.collection.map do |record|
    opts = {
      :@rid => "##{options[:cluster_id]}:#{options[:cluster_position]}",
      :@version => record[:version],
      :@type => record[:record_type]
    }
    OrientdbBinary::Parser::Deserializer.new().deserialize(record[:content], opts)
  end

  prefetched = self.prefetched_records.map do |record|
    if record[:payload_status] > 0
      opts = {
        :@rid => "##{record[:cluster_id]}:#{record[:position]}",
        :@version => record[:version],
        :@type => record[:record_type]
      }
      OrientdbBinary::Parser::Deserializer.new().deserialize(record[:content], opts)
    end
  end

  {collection: colls, prefetched_records: prefetched.delete_if {|rec| !rec}}
end