Class: Plamo::FormDataField

Inherits:
Object
  • Object
show all
Defined in:
ext/plamo/plamo_form_data_field.c

Instance Method Summary collapse

Instance Method Details

#fileObject



31
32
33
34
35
36
37
38
39
40
41
# File 'ext/plamo/plamo_form_data_field.c', line 31

static VALUE get_file(VALUE self) {
  PlamoFormDataField *plamo_form_data_field;
  TypedData_Get_Struct(self, PlamoFormDataField, &rb_plamo_form_data_field_type, plamo_form_data_field);
  if (plamo_form_data_field->file) {
    VALUE rb_plamo_form_data_file = TypedData_Wrap_Struct(rb_cPlamoFormDataFile, &rb_plamo_form_data_file_type, plamo_form_data_field->file);
    OBJ_FREEZE(rb_plamo_form_data_file);
    return rb_plamo_form_data_file;
  } else {
    return Qnil;
  }
}

#file?Boolean

Returns:

  • (Boolean)


53
54
55
56
57
58
59
60
61
# File 'ext/plamo/plamo_form_data_field.c', line 53

static VALUE is_file(VALUE self) {
  PlamoFormDataField *plamo_form_data_field;
  TypedData_Get_Struct(self, PlamoFormDataField, &rb_plamo_form_data_field_type, plamo_form_data_field);
  if (plamo_form_data_field->file) {
    return Qtrue;
  } else {
    return Qfalse;
  }
}

#textObject



21
22
23
24
25
26
27
28
29
# File 'ext/plamo/plamo_form_data_field.c', line 21

static VALUE get_text(VALUE self) {
  PlamoFormDataField *plamo_form_data_field;
  TypedData_Get_Struct(self, PlamoFormDataField, &rb_plamo_form_data_field_type, plamo_form_data_field);
  if (plamo_form_data_field->text) {
    return rb_str_new2(plamo_string_get_char(plamo_form_data_field->text));
  } else {
    return Qnil;
  }
}

#text?Boolean

Returns:

  • (Boolean)


43
44
45
46
47
48
49
50
51
# File 'ext/plamo/plamo_form_data_field.c', line 43

static VALUE is_text(VALUE self) {
  PlamoFormDataField *plamo_form_data_field;
  TypedData_Get_Struct(self, PlamoFormDataField, &rb_plamo_form_data_field_type, plamo_form_data_field);
  if (plamo_form_data_field->text) {
    return Qtrue;
  } else {
    return Qfalse;
  }
}