sNew := "new" str_new := (*C.char)(unsafe.Pointer(&(*(*[]byte)(unsafe.Pointer(&sNew)))[0])) rb_cRequest = rb_define_class("Request", C.rb_cObject) C.rb_undef_alloc_func(rb_cRequest) C.rb_undef_method(C.rb_class_of(rb_cRequest), str_new) rb_define_method(rb_cRequest, "method", C.reqMethod, 0) //rb_define_method(rb_cRequest, "url", C.reqURL, 0) rb_define_method(rb_cRequest, "proto", C.reqProto, 0) rb_define_method(rb_cRequest, "header", C.reqHeader, 0) rb_define_method(rb_cRequest, "body", C.reqBody, 0) rb_define_method(rb_cRequest, "content_length", C.reqContentLength, 0) rb_define_method(rb_cRequest, "transfer_encoding", C.reqTransferEncoding, 0) rb_define_method(rb_cRequest, "host", C.reqHost, 0) //rb_define_method(rb_cRequest, "form", C.reqForm, 0) //rb_define_method(rb_cRequest, "post_form", C.reqForm, 0) //rb_define_method(rb_cRequest, "multipart_form", C.reqForm, 0) //rb_define_method(rb_cRequest, "trailer", C.reqForm, 0) rb_define_method(rb_cRequest, "remote_addr", C.reqRemoteAddr, 0) rb_define_method(rb_cRequest, "request_uri", C.reqRequestURI, 0)