From d242ffdf477689cea8192a8b7ddbafb630f1178b Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Thu, 21 Jan 2016 14:45:15 -0800 Subject: idiomiaticify conversion of arbitrary input into a real Boolean. --- lib/chef_zero/rest_base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chef_zero/rest_base.rb b/lib/chef_zero/rest_base.rb index 928d2e7..a03f4aa 100644 --- a/lib/chef_zero/rest_base.rb +++ b/lib/chef_zero/rest_base.rb @@ -200,7 +200,7 @@ module ChefZero end def json_response(response_code, json, request_version=0, response_version=0, opts={pretty: true}) - do_pretty_json = opts[:pretty] && true + do_pretty_json = !!opts[:pretty] # make sure we have a proper Boolean. already_json_response(response_code, FFI_Yajl::Encoder.encode(json, :pretty => do_pretty_json), request_version, response_version) end -- cgit v1.2.1