README.adoc in refinements-12.9.0 vs README.adoc in refinements-12.10.0

- old
+ new

@@ -18,10 +18,11 @@ * DateTime * Hash * IO * LogDevice * Logger +* Module * Object * Pathname * String * StringIO * Struct @@ -85,10 +86,11 @@ require "refinements/date_time" require "refinements/hash" require "refinements/io" require "refinements/log_device" require "refinements/logger" +require "refinements/module" require "refinements/object" require "refinements/pathname" require "refinements/string" require "refinements/string_io" require "refinements/struct" @@ -109,10 +111,11 @@ using Refinements::DateTime using Refinements::Hash using Refinements::IO using Refinements::LogDevice using Refinements::Logger + using Refinements::Module using Refinements::Object using Refinements::Pathname using Refinements::String using Refinements::StringIO using Refinements::Struct @@ -184,10 +187,12 @@ [1, 2, 3, 4, 5].excluding 4, 5 # [1, 2, 3] ---- ===== #filter_find +⚠️ _This is deprecated and will be removed in Version 13.0.0._ + Answers the first element which evaluates to true from a filtered collection. [source,ruby] ---- handlers = [ @@ -967,20 +972,47 @@ ===== #any Allows you to log _any_ message which is identical in behavior and functionality to the `Logger#unknown` method only this requires less typing and better matches the terminology used by the `#unknown` method. -``` ruby +[source,ruby] +---- logger = Logger.new STDOUT logger.any "Test." # A, [2000-01-10T09:00:00.847428 #44925] ANY -- : Test. logger.any { "Test." } A, [2000-01-10T09:00:00.330719 #44925] ANY -- : Test. -``` +---- +==== Module + +===== #pseudonym + +Allows you to set a temporary name for your anonymous `Module` (or `Class` since `Class` inherits from `Module`) with a better default than what `+#set_temporary_name+` provides. + +[source,ruby] +---- +Module.new.pseudonym "demo" # demo-44600 +Module.new.pseudonym "demo", delimiter: "_" # demo_60900 +Module.new.pseudonym "demo", nil # demo- +Module.new.pseudonym "demo", nil, delimiter: nil # demo +---- + +The same applies for anonymous classes since classes inherit from modules: + +[source,ruby] +---- +Class.new.pseudonym "demo" # demo-44600 < Object +Class.new.pseudonym "demo", delimiter: "_" # demo_60900 < Object +Class.new.pseudonym "demo", nil # demo- < Object +Class.new.pseudonym "demo", nil, delimiter: nil # demo < Object +---- + +💡 While convenient, if you find yourself nullifying the suffix and/or delimiter, you're better off using `+#set_temporary_name+`. + ==== Object ===== #in? Allows you to know if `self` is included in, or an element of, the target object. @@ -1595,9 +1627,11 @@ ---- ==== Struct ===== .with_positions + +⚠️ _This is deprecated and will be removed in Version 13.0.0._ Answers a struct instance with given positional arguments regardless of whether the struct was constructed with positional or keyword arguments. [source,ruby]