diff options
| author | Takashi Sakaguchi <takashi.sakaguchi@ummm.info> | 2025-12-26 12:37:46 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-12-26 03:38:16 +0000 |
| commit | 594dd8bfd4c2b380dc7185d421d71b29c379356b (patch) | |
| tree | ea032b53696b048918d91dc6bf11f6464879737c /lib | |
| parent | 9824724b2ffe583302e9318c6eff7a440478125f (diff) | |
[ruby/pp] Support private instance_variables_to_inspect
(https://github.com/ruby/pp/pull/70)
* Support private instance_variables_to_inspect in pp
Ruby supports calling instance_variables_to_inspect even when
it is defined as a private method (ruby/ruby#13555).
This change aligns pp with Ruby's behavior.
https://github.com/ruby/pp/commit/8450e76db6
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pp.rb | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -388,7 +388,7 @@ class PP < PrettyPrint # This method should return an array of names of instance variables as symbols or strings as: # +[:@a, :@b]+. def pretty_print_instance_variables - ivars = respond_to?(:instance_variables_to_inspect) ? instance_variables_to_inspect : instance_variables + ivars = respond_to?(:instance_variables_to_inspect, true) ? instance_variables_to_inspect || instance_variables : instance_variables ivars.sort end |
