summaryrefslogtreecommitdiff
path: root/NEWS.md
diff options
context:
space:
mode:
Diffstat (limited to 'NEWS.md')
-rw-r--r--NEWS.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index 7fdc195653..b332164e25 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -14,6 +14,26 @@ Note that each entry is kept to a minimum, see links for details.
Note: We're only listing outstanding class updates.
+* Kernel
+
+ * `Kernel#inspect` now checks for the existence of a `#instance_variables_to_inspect` method,
+ allowing control over which instance variables are displayed in the `#inspect` string:
+
+ ```ruby
+ class DatabaseConfig
+ def initialize(host, user, password)
+ @host = host
+ @user = user
+ @password = password
+ end
+
+ private def instance_variables_to_inspect = [:@host, :@user]
+ end
+
+ conf = DatabaseConfig.new("localhost", "root", "hunter2")
+ conf.inspect #=> #<DatabaseConfig:0x0000000104def350 @host="localhost", @user="root">
+ ```
+
* Binding
* `Binding#local_variables` does no longer include numbered parameters.