naive_bayes/resources/ruby/connection.rb
# Write messages to the connection in a single network call.
#
# @example Write the messages to the connection.
#   connection.write([ insert ])
#
# @note All messages must be instances of Mongo::Protocol::Message.
#
# @param [ Array<Message> ] messages The messages to write.
# @param [ String ] buffer The buffer to write to.
#
# @return [ Integer ] The number of bytes written.
#
# @since 3.0.0
Write messages to the connection in a single network call.
Write messages to the connection in a single network call .
def write(messages, buffer = '')
        messages.each do |message|
          message.serialize(buffer)
        end
        ensure_connected do |socket|
          socket.write(buffer)
        end
      end
def write ( messages , buffer = '' ) messages . each do | message | message . serialize ( buffer ) end ensure_connected do | socket | socket . write ( buffer ) end end
Write messages to the connection in a single network call.
Write messages to the connection in a single network call .
The number of bytes written.
The number of bytes written .
 Integer 
messages
<not_specific>
buffer
<not_specific>
<not_specific>
buffer The buffer to write to.
buffer The buffer to write to .
example
Write the messages to the connection. connection.write([ insert ])
Write the messages to the connection . connection . write ( [ insert ] )
note
All messages must be instances of Mongo::Protocol::Message.
All messages must be instances of Mongo :: Protocol :: Message .
since
None