Sha256: 724e535488aab3e16ec282dba0ac981dece52014443a9c6b5dd01d0d21e23d71

Contents?: true

Size: 314 Bytes

Versions: 7

Compression:

Stored size: 314 Bytes

Contents

== Comparable#cmp

  require 'facets/comparable/cmp'

on integers

  3.cmp(4).assert == -1
  3.cmp(3).assert ==  0
  3.cmp(2).assert ==  1

on strings

  "abc".cmp("abc").assert == 0
  "abc".cmp("abcd").assert == -1
  "abcd".cmp("abc").assert ==  1
  "abc".cmp("bcd").assert == -1
  "bcd".cmp("abc").assert ==  1

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
facets-3.0.0 demo/core/comparable/cmp.rdoc
facets-2.9.3 qed/core/comparable/cmp.rdoc
facets-2.9.2 qed/core/comparable/cmp.rdoc
facets-2.9.1 qed/core/comparable/cmp.rdoc
facets-2.9.0 qed/core/comparable/cmp.rdoc
facets-2.9.0.pre.2 qed/core/comparable/cmp.rdoc
facets-2.9.0.pre.1 qed/core/comparable/cmp.rdoc