Created
February 21, 2015 23:45
-
-
Save carlesso/e27b362e5b9bd8d69b3b to your computer and use it in GitHub Desktop.
Pry show-method applied to .=~
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[16] pry(main)> show-method 'string'.=~ | |
From: string.c (C Method): | |
Owner: String | |
Visibility: public | |
Number of lines: 14 | |
static VALUE | |
rb_str_match(VALUE x, VALUE y) | |
{ | |
switch (TYPE(y)) { | |
case T_STRING: | |
rb_raise(rb_eTypeError, "type mismatch: String given"); | |
case T_REGEXP: | |
return rb_reg_match(y, x); | |
default: | |
return rb_funcall(y, rb_intern("=~"), 1, x); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment