Class: Curl::Upload
- Inherits:
-
Object
- Object
- Curl::Upload
- Defined in:
- ext/curb_upload.c
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.class ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 |
# File 'ext/curb_upload.c', line 47 VALUE ruby_curl_upload_new(VALUE klass) { VALUE upload; ruby_curl_upload *rbcu = ALLOC(ruby_curl_upload); if (!rbcu) { rb_raise(rb_eNoMemError, "Failed to allocate memory for Curl::Upload"); } rbcu->stream = Qnil; rbcu->offset = 0; upload = TypedData_Wrap_Struct(klass, &ruby_curl_upload_data_type, rbcu); return upload; } |
Instance Method Details
#class ⇒ Object
92 93 94 95 96 |
# File 'ext/curb_upload.c', line 92 VALUE ruby_curl_upload_offset_get(VALUE self) { ruby_curl_upload *rbcu; TypedData_Get_Struct(self, ruby_curl_upload, &ruby_curl_upload_data_type, rbcu); return LONG2NUM(rbcu->offset); } |
#class ⇒ Object
82 83 84 85 86 87 |
# File 'ext/curb_upload.c', line 82 VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset) { ruby_curl_upload *rbcu; TypedData_Get_Struct(self, ruby_curl_upload, &ruby_curl_upload_data_type, rbcu); rbcu->offset = NUM2LONG(offset); return offset; } |
#class ⇒ Object
73 74 75 76 77 |
# File 'ext/curb_upload.c', line 73 VALUE ruby_curl_upload_stream_get(VALUE self) { ruby_curl_upload *rbcu; TypedData_Get_Struct(self, ruby_curl_upload, &ruby_curl_upload_data_type, rbcu); return rbcu->stream; } |
#class ⇒ Object
63 64 65 66 67 68 |
# File 'ext/curb_upload.c', line 63 VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream) { ruby_curl_upload *rbcu; TypedData_Get_Struct(self, ruby_curl_upload, &ruby_curl_upload_data_type, rbcu); rbcu->stream = stream; return stream; } |