summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Doherty <cdoherty@chef.io>2016-01-21 14:45:15 -0800
committerChris Doherty <cdoherty@chef.io>2016-01-21 15:52:48 -0800
commitd242ffdf477689cea8192a8b7ddbafb630f1178b (patch)
tree6d354ddeb674afcd04dda478176b95692d7442bc
parent97cd3666dc12f437fc6f8cd72001a8307e2e7898 (diff)
downloadchef-zero-d242ffdf477689cea8192a8b7ddbafb630f1178b.tar.gz
idiomiaticify conversion of arbitrary input into a real Boolean.
-rw-r--r--lib/chef_zero/rest_base.rb2
1 files changed, 1 insertions, 1 deletions
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