summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2021-12-18 12:32:11 -0600
committerGitHub <noreply@github.com>2021-12-18 12:32:11 -0600
commit7e0e6f90744ec89a87554d209fb797ddf7919319 (patch)
treefa06dc275066eaca2d9b246d6636d68a824989d9 /hash.c
parent1ed520a9ef0ceb5fa9f9480505d10a72c7014430 (diff)
What's Here for ENV (#5292)
[DOC] What's Here for ENV
Notes
Notes: Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 3e59458dab..1155a5756b 100644
--- a/hash.c
+++ b/hash.c
@@ -7312,6 +7312,86 @@ Init_Hash(void)
* so most example snippets begin by resetting the contents of ENV:
* - ENV.replace replaces ENV with a new collection of entries.
* - ENV.clear empties ENV.
+ *
+ * == What's Here
+ *
+ * First, what's elsewhere. \Class \ENV:
+ *
+ * - Inherits from {class Object}[Object.html#class-Object-label-What-27s+Here].
+ * - Extends {module Enumerable}[Enumerable.html#module-Enumerable-label-What-27s+Here],
+ *
+ * Here, class \ENV provides methods that are useful for:
+ *
+ * - {Querying}[#class-ENV-label-Methods+for+Querying]
+ * - {Assigning}[#class-ENV-label-Methods+for+Assigning]
+ * - {Deleting}[#class-ENV-label-Methods+for+Deleting]
+ * - {Iterating}[#class-ENV-label-Methods+for+Iterating]
+ * - {Converting}[#class-ENV-label-Methods+for+Converting]
+ * - {And more ....}[#class-ENV-label-More+Methods]
+ *
+ * === Methods for Querying
+ *
+ * - ::[]:: Returns the value for the given environment variable name if it exists:
+ * - ::empty?:: Returns whether \ENV is empty.
+ * - ::has_value?, ::value?:: Returns whether the given value is in \ENV.
+ * - ::include?, ::has_key?, ::key?, ::member?:: Returns whether the given name
+ is in \ENV.
+ * - ::key:: Returns the name of the first entry with the given value.
+ * - ::size, ::length:: Returns the number of entries.
+ * - ::value?:: Returns whether any entry has the given value.
+ *
+ * === Methods for Assigning
+ *
+ * - ::[]=, ::store:: Creates, updates, or deletes the named environment variable.
+ * - ::clear:: Removes every environment variable; returns \ENV:
+ * - ::update, ::merge!:: Adds to \ENV each key/value pair in the given hash.
+ * - ::replace:: Replaces the entire content of the \ENV
+ * with the name/value pairs in the given hash.
+ *
+ * === Methods for Deleting
+ *
+ * - ::delete:: Deletes the named environment variable name if it exists.
+ * - ::delete_if:: Deletes entries selected by the block.
+ * - ::keep_if:: Deletes entries not selected by the block.
+ * - ::reject!:: Similar to #delete_if, but returns +nil+ if no change was made.
+ * - ::select!, ::filter!:: Deletes entries selected by the block.
+ * - ::shift:: Removes and returns the first entry.
+ *
+ * === Methods for Iterating
+ *
+ * - ::each, ::each_pair:: Calls the block with each name/value pair.
+ * - ::each_key:: Calls the block with each name.
+ * - ::each_value:: Calls the block with each value.
+ *
+ * === Methods for Converting
+ *
+ * - ::assoc:: Returns a 2-element array containing the name and value
+ * of the named environment variable if it exists:
+ * - ::clone:: Returns \ENV (and issues a warning).
+ * - ::except:: Returns a hash of all name/value pairs except those given.
+ * - ::fetch:: Returns the value for the given name.
+ * - ::inspect:: Returns the contents of \ENV as a string.
+ * - ::invert:: Returns a hash whose keys are the ENV values,
+ and whose values are the corresponding ENV names.
+ * - ::keys:: Returns an array of all names.
+ * - ::rassoc:: Returns the name and value of the first found entry
+ * that has the given value.
+ * - ::reject:: Returns a hash of those entries not rejected by the block.
+ * - ::select, ::filter:: Returns a hash of name/value pairs selected by the block.
+ * - ::slice:: Returns a hash of the given names and their corresponding values.
+ * - ::to_a:: Returns the entries as an array of 2-element Arrays.
+ * - ::to_h:: Returns a hash of entries selected by the block.
+ * - ::to_hash:: Returns a hash of all entries.
+ * - ::to_s:: Returns the string <tt>'ENV'</tt>.
+ * - ::values:: Returns all values as an array.
+ * - ::values_at:: Returns an array of the values for the given name.
+ *
+ * === More Methods
+ *
+ * - ::dup:: Raises an exception.
+ * - ::freeze:: Raises an exception.
+ * - ::rehash:: Returns +nil+, without modifying \ENV.
+ *
*/
/*