Sha256: 47676528457c079168ddf5270d4f3fc12f4f0d34d4476712820820ae488aa2c2
Contents?: true
Size: 484 Bytes
Versions: 7
Compression:
Stored size: 484 Bytes
Contents
== Comparable#[] require 'facets/comparable/op_get' c = Class.new do include Comparable[:a,:b] attr_accessor :a, :b def initialize(a,b) @a=a; @b=b end end a = [c.new(10,20),c.new(10,30)] a.sort.assert == a a = [c.new(10,30),c.new(10,20)] a.sort.assert == a.reverse a = [c.new(10,10),c.new(20,10)] a.sort.assert == a a = [c.new(20,10),c.new(10,10)] a.sort.assert == a.reverse a = [c.new(10,30),c.new(20,10)] a.sort.assert == a
Version data entries
7 entries across 7 versions & 1 rubygems