#-- # Tuple # # Copyright (c) 2005 Thomas Sawyer # # Ruby License # # This module is free software. You may use, modify, and/or # redistribute this software under the same terms as Ruby. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # ========================================================================== # Revision History: # ========================================================================== # # 2005.04.24 trans Minor modifications to documentation. # # ========================================================================== # # :TODO: Not a true tuple? # This class probably needs some enhancements to be truly considered a # Tuple. For instance, should a Tuple by multiton? # #++ #:title: Tuple # # A Tuple is essentially an Array that is also Comaparable. # # == Usage # # t1 = Tuple.new(1,2,3) # t2 = Tuple.new(2,3,4) # # t1 > t2 #=> false # t2 > t1 #=> true # class Tuple < Array include Comparable def initialize(*args) super() self.concat args end end