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
| 24 25 26 27 28 29 30 31 32 33 34 | # File 'ext/curb_upload.c', line 24
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 = Data_Wrap_Struct(klass, curl_upload_mark, curl_upload_free, rbcu);
  return upload;
} | 
Instance Method Details
#class ⇒ Object
| 69 70 71 72 73 | # File 'ext/curb_upload.c', line 69
VALUE ruby_curl_upload_offset_get(VALUE self) {
  ruby_curl_upload *rbcu;
  Data_Get_Struct(self, ruby_curl_upload, rbcu);
  return LONG2NUM(rbcu->offset);
} | 
#class ⇒ Object
| 59 60 61 62 63 64 | # File 'ext/curb_upload.c', line 59
VALUE ruby_curl_upload_offset_set(VALUE self, VALUE offset) {
  ruby_curl_upload *rbcu;
  Data_Get_Struct(self, ruby_curl_upload, rbcu);
  rbcu->offset = NUM2LONG(offset);
  return offset;
} | 
#class ⇒ Object
| 50 51 52 53 54 | # File 'ext/curb_upload.c', line 50
VALUE ruby_curl_upload_stream_get(VALUE self) {
  ruby_curl_upload *rbcu;
  Data_Get_Struct(self, ruby_curl_upload, rbcu);
  return rbcu->stream;
} | 
#class ⇒ Object
| 40 41 42 43 44 45 | # File 'ext/curb_upload.c', line 40
VALUE ruby_curl_upload_stream_set(VALUE self, VALUE stream) {
  ruby_curl_upload *rbcu;
  Data_Get_Struct(self, ruby_curl_upload, rbcu);
  rbcu->stream = stream;
  return stream;
} |