Class: Lorraine::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/lorraine/server.rb

Class Method Summary collapse

Class Method Details

.send_message(message, address = "localhost", port = "3010") ⇒ Object



47
48
49
50
51
52
53
54
55
56
# File 'lib/lorraine/server.rb', line 47

def self.send_message(message, address = "localhost", port = "3010")
  
  faye_json = {channel: "/illuminate", data: message.packet}.to_json
  
  puts "sending json: #{faye_json}"
 
  client = HTTPClient.new
  puts client.post("http://#{address}:#{port}/faye", {message: faye_json})

end