rstacruz/js2coffee — Issue #118: support class in coffeescript
Author: keichii
Created: 2012-01-09 06:44:01+00:00
State: open

try converting this code to javascript and vice versa: its not consistent
its not working too in the coffee IDE in linux: error

http://coffeescript.org/#classes

class HandlerSocket
constructor: ->
hs = require 'node-handlersocket'
@con = hs.connect {port : 9999}
find:->
@con.openIndex database, table, index, columns, (err, index)->
index.find '=', [ 1 ], (err, results)->
console.log results[0]
@con.end()
insert:->
@con.on 'connect', ->
@con.openIndex database, table, index, columns, (err, index)->
index.insert [100, 9999, 'KOICHIK'], (err)->
@con.end()
update:->
@con.on 'connect', ->
@con.openIndex database, table, index, columns, (err, index)->
index.update '=', 100, [100, 9999, 'EBIYURI'], (err, rows)->
console.log rows
@con.end();
delete:->
@con.on 'connect', ->
@con.openIndex database, table, index, columns, (err, index)->
index.delete '=', 100, (err, rows)->
console.log rows
@con.end()