Class: Lorraine::NetworkConnection

Inherits:
Connection show all
Defined in:
lib/lorraine/network_connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Connection

#animate_to_image, #display_image, #display_pixels, #initialize, #sever!

Constructor Details

This class inherits a constructor from Lorraine::Connection

Instance Attribute Details

#hostnameObject



6
7
8
# File 'lib/lorraine/network_connection.rb', line 6

def hostname
  @hostname || "localhost"
end

#portObject



11
12
13
# File 'lib/lorraine/network_connection.rb', line 11

def port
  @port || "3010"
end

Instance Method Details

#write_message(msg) ⇒ Object



15
16
17
18
# File 'lib/lorraine/network_connection.rb', line 15

def write_message(msg)
  Lorraine::Client.send_message(msg, self.hostname, self.port)
  puts "Writing network message: #{msg}"
end