ext/console/console.c in console-0.1 vs ext/console/console.c in console-0.2
- old
+ new
@@ -61,11 +61,11 @@
static const char* default_pad_string = " ";
/*
* call-seq:
- * slice(string, start_offset, display_width=1, pad_string=" ")
+ * display_slice(string, start_offset, display_width=1, pad_string=" ")
*
* Returns a slice of a string based on display width, rather than character or
* bytes. I.e, the <code>start_offset</code> and <code>display_width</code>
* offsets index the columns required to display the string, and not individual
* characters or bytes.
@@ -87,11 +87,11 @@
* it is in, into the current locale's encoding, for processing. This may fail.
*
* The returned string WILL be in the current locale encoding, regardless of the
* encoding of the original string.
*/
-static VALUE slice(int argc, VALUE *argv, VALUE v_self) {
+static VALUE display_slice(int argc, VALUE *argv, VALUE v_self) {
VALUE v_string, v_display_start, v_display_width, v_pad_string;
rb_scan_args(argc, argv, "22", &v_string, &v_display_start, &v_display_width, &v_pad_string);
Check_Type(v_string, T_STRING);
/* try and mimic String#slice's argument handling as much as possible */
@@ -187,17 +187,17 @@
*
* Provides:
*
* Console.display_width: get the number of display columns used by a string.
*
- * Console.slice: get a substrig by display column offset and size.
+ * Console.display_slice: get a substrig by display column offset and size.
*
*/
void Init_console() {
VALUE cConsole;
cConsole = rb_define_class("Console", rb_cObject);
rb_define_module_function(cConsole, "display_width", display_width, 1);
- rb_define_module_function(cConsole, "slice", slice, -1);
+ rb_define_module_function(cConsole, "display_slice", display_slice, -1);
}