HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/ri/2.6.0/system/Set/cdesc-Set.ri
U:RDoc::NormalClass[iI"Set:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"ISet implements a collection of unordered values with no duplicates. ;TI"JThis is a hybrid of Array's intuitive inter-operation facilities and ;TI"Hash's fast lookup.;To:RDoc::Markup::BlankLineo;	;[	I"GSet is easy to use with Enumerable objects (implementing +each+). ;TI"IMost of the initializer methods and binary operators accept generic ;TI"GEnumerable objects besides sets and arrays.  An Enumerable object ;TI"7can be converted to Set using the +to_set+ method.;T@o;	;[I"ESet uses Hash as storage, so you must note the following points:;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;	;[I"EEquality of elements is determined according to Object#eql? and ;TI"EObject#hash.  Use Set#compare_by_identity to make a set compare ;TI"$its elements by their identity.;To;;0;[o;	;[I"CSet assumes that the identity of each element does not change ;TI"Hwhile it is stored.  Modifying an element of a set will render the ;TI" set to an unreliable state.;To;;0;[o;	;[I"CWhen a string is to be stored, a frozen copy of the string is ;TI"Astored instead unless the original string is already frozen.;T@S:RDoc::Markup::Heading:
leveli:	textI"Comparison;T@o;	;[	I"BThe comparison operators <, >, <=, and >= are implemented as ;TI"Hshorthand for the {proper_,}{subset?,superset?} methods.  However, ;TI"Jthe <=> operator is intentionally left out because not every pair of ;TI"8sets is comparable ({x, y} vs. {x, z} for example).;T@S;;i;I"Example;T@o:RDoc::Markup::Verbatim;[
I"require 'set'
;TI">s1 = Set[1, 2]                        #=> #<Set: {1, 2}>
;TI">s2 = [1, 2].to_set                    #=> #<Set: {1, 2}>
;TI"4s1 == s2                              #=> true
;TI"Es1.add("foo")                         #=> #<Set: {1, 2, "foo"}>
;TI"Hs1.merge([2, 6])                      #=> #<Set: {1, 2, "foo", 6}>
;TI"5s1.subset?(s2)                        #=> false
;TI"4s2.subset?(s1)                        #=> true
;T:@format0S;;i;I"Contact;T@o;;[I"<- Akinori MUSHA <knu@iDaemons.org> (current maintainer);T;0:
@fileI"lib/set.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[[[[I"Enumerable;To;;[;@K;0I"lib/set.rb;T[[I"
class;T[[:public[[I"[];T@S[I"new;T@S[:protected[[:private[[I"
instance;T[[;[<[I"&;T@S[I"+;T@S[I"-;T@S[I"<;T@S[I"<<;T@S[I"<=;T@S[I"==;T@S[I"===;T@S[I">;T@S[I">=;T@S[I"^;T@S[I"add;T@S[I"	add?;T@S[I"
classify;T@S[I"
clear;T@S[I"
collect!;T@S[I"compare_by_identity;T@S[I"compare_by_identity?;T@S[I"delete;T@S[I"delete?;T@S[I"delete_if;T@S[I"difference;T@S[I"disjoint?;T@S[I"divide;T@S[I"	each;T@S[I"empty?;T@S[I"filter!;T@S[I"flatten;T@S[I"
flatten!;T@S[I"
include?;T@S[I"initialize_clone;T@S[I"initialize_dup;T@S[I"inspect;T@S[I"intersect?;T@S[I"intersection;T@S[I"keep_if;T@S[I"length;T@S[I"	map!;T@S[I"member?;T@S[I"
merge;T@S[I"proper_subset?;T@S[I"proper_superset?;T@S[I"reject!;T@S[I"replace;T@S[I"
reset;T@S[I"select!;T@S[I"	size;T@S[I"subset?;T@S[I"
subtract;T@S[I"superset?;T@S[I"	to_a;T@S[I"	to_s;T@S[I"to_set;T@S[I"
union;T@S[I"|;T@S[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[@K@KcRDoc::TopLevel