| Server IP : 162.214.74.102 / Your IP : 216.73.217.21 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/Comparable/ |
Upload File : |
U:RDoc::NormalModule[iI"Comparable:ET@0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"HThe <code>Comparable</code> mixin is used by classes whose objects ;TI"Jmay be ordered. The class must define the <code><=></code> operator, ;TI"Jwhich compares the receiver against another object, returning -1, 0, ;TI"Hor +1 depending on whether the receiver is less than, equal to, or ;TI"Jgreater than the other object. If the other object is not comparable ;TI";then the <code><=></code> operator should return nil. ;TI""<code>Comparable</code> uses ;TI"I<code><=></code> to implement the conventional comparison operators ;TI"I(<code><</code>, <code><=</code>, <code>==</code>, <code>>=</code>, ;TI">and <code>></code>) and the method <code>between?</code>.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim;[I"class SizeMatters
;TI" include Comparable
;TI" attr :str
;TI" def <=>(other)
;TI"% str.size <=> other.str.size
;TI" end
;TI" def initialize(str)
;TI" @str = str
;TI" end
;TI" def inspect
;TI" @str
;TI" end
;TI" end
;TI"
;TI"s1 = SizeMatters.new("Z")
;TI" s2 = SizeMatters.new("YY")
;TI"!s3 = SizeMatters.new("XXX")
;TI""s4 = SizeMatters.new("WWWW")
;TI"#s5 = SizeMatters.new("VVVVV")
;TI"
;TI",s1 < s2 #=> true
;TI"-s4.between?(s1, s3) #=> false
;TI",s4.between?(s3, s5) #=> true
;TI"@[ s3, s2, s5, s4, s1 ].sort #=> [Z, YY, XXX, WWWW, VVVVV];T:@format0:
@fileI"
compar.c;T:0@omit_headings_from_table_of_contents_below0;
0;0[ [ [ [[I"
class;T[[:public[ [:protected[ [:private[ [I"
instance;T[[;[[I"<;TI"
compar.c;T[I"<=;T@H[I"==;T@H[I">;T@H[I">=;T@H[I"
between?;T@H[I"
clamp;T@H[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;
0;0[@3@3cRDoc::TopLevel