Permalink
Browse files

addded code to evaluate JSON::XS::Boolean values.

  • Loading branch information...
1 parent bf82432 commit 04c62e5445e006cb9b66704220346223a315c477 @three18ti committed Jan 14, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 source/Reddit/lib/Reddit.pm
@@ -241,6 +241,11 @@ sub get_user_info {
my $data = $decoded->{data};
print Dumper $data ;
+ foreach my $value ( values %$result ) {
+ next unless 'JSON::XS::Boolean' eq ref $value;
+ $value = $value ? '1' : '0' ;
+ }
+
while (my ($key, $value) = each %{$data}) {
$self->user_info->$key("$value");
}

0 comments on commit 04c62e5

Please sign in to comment.