Skip to content

Commit

Permalink
docs(compar.c): change class name in example
Browse files Browse the repository at this point in the history
  • Loading branch information
SoManyHs authored and hsbt committed Dec 10, 2023
1 parent 91b0d5f commit e5e53ee
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions compar.c
Expand Up @@ -263,25 +263,28 @@ cmp_clamp(int argc, VALUE *argv, VALUE x)
* <code>==</code>, <code>>=</code>, and <code>></code>) and the
* method <code>between?</code>.
*
* class SizeMatters
* class StringSorter
* include Comparable
*
* attr :str
* def <=>(other)
* str.size <=> other.str.size
* end
*
* def initialize(str)
* @str = str
* end
*
* def inspect
* @str
* end
* end
*
* s1 = SizeMatters.new("Z")
* s2 = SizeMatters.new("YY")
* s3 = SizeMatters.new("XXX")
* s4 = SizeMatters.new("WWWW")
* s5 = SizeMatters.new("VVVVV")
* s1 = StringSorter.new("Z")
* s2 = StringSorter.new("YY")
* s3 = StringSorter.new("XXX")
* s4 = StringSorter.new("WWWW")
* s5 = StringSorter.new("VVVVV")
*
* s1 < s2 #=> true
* s4.between?(s1, s3) #=> false
Expand Down

0 comments on commit e5e53ee

Please sign in to comment.