Sha256: 28d3fe50d23872f4f4824fd78a4c4a832fa120003d05fbfa028a057c13c2c5ee

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

class SatParser < EventMachine::Connection
    
  attr_accessor :db  
    
  def post_init
#    $clients(self)
    puts self.inspect
    db = EventMachine::MySQL.new(:host => "localhost", :username => "root", :database => "keyhole_development")
    $channel << "{event:'connect', 'type':'tracker'}"
  end
  
  def receive_data(data)
    puts "Data received..."
    puts data.inspect
    db.query("insert into locations(latitude, longitude) value('ninja', 'neger');")
    $channel << data
  end
  
  def unbind
    $channel << "GSAT closed connection"
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
keyhole-0.1.2 lib/sat_parser.rb