add ddp config toggles

Wed, 14 Mar 2018 11:18:34 -0700

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 14 Mar 2018 11:18:34 -0700
changeset 703
cce8cf3118c5
parent 702
f817544836c7
child 704
7118c036f770

add ddp config toggles

.replyrc.pl file | annotate | diff | comparison | revisions
--- a/.replyrc.pl
+++ b/.replyrc.pl
@@ -7,4 +7,22 @@ use Data::Printer {
 
 use Path::Tiny;
 
+
+# This is extra awkward bc Data::Printer has no introspection of its config.
+# These values need to mirror what's set above, or defaults.
+my $ddp_show_private   = 0;
+my $ddp_show_inherited = 1;
+
+sub ddp_toggle_private {
+  my $val = ($ddp_show_private ^= 1) ? 'all' : 'public';
+  Data::Printer->import({class => {show_methods => $val}});
+  $val;
+}
+
+sub ddp_toggle_inherited {
+  my $val = ($ddp_show_inherited ^= 1) ? 'public' : 'none';
+  Data::Printer->import({class => {inherited => $val}});
+  $val;
+}
+
 1;

mercurial