From b16e7684d6faf4ef768a718cdda1d7be75a18e7b Mon Sep 17 00:00:00 2001 From: Matthew Molloy Date: Tue, 11 Jul 2017 11:39:27 +0800 Subject: [PATCH] added type coercion for booleans --- project.clj | 2 +- src/google_apps_clj/google_sheets_v4.clj | 6 ++++++ test/google_apps_clj/google_sheets_v4_test.clj | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 1bd1211..0ab33d9 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject google-apps-clj "0.6.1" +(defproject google-apps-clj "0.6.2" :description "A Clojure library that wraps the Google Java API" :url "https://github.com/SparkFund/google-apps-clj" :license {:name "Apache License, Version 2.0" diff --git a/src/google_apps_clj/google_sheets_v4.clj b/src/google_apps_clj/google_sheets_v4.clj index 4dc9668..cf2b1de 100644 --- a/src/google_apps_clj/google_sheets_v4.clj +++ b/src/google_apps_clj/google_sheets_v4.clj @@ -126,6 +126,12 @@ (.setUserEnteredValue (-> (ExtendedValue.) (.setNumberValue (double n)))))) + Boolean + (->cell-data [b] + (-> (CellData.) + (.setUserEnteredValue + (-> (ExtendedValue.) + (.setBoolValue b))))) String (->cell-data [s] (-> (CellData.) diff --git a/test/google_apps_clj/google_sheets_v4_test.clj b/test/google_apps_clj/google_sheets_v4_test.clj index 76a9c70..dd668ff 100644 --- a/test/google_apps_clj/google_sheets_v4_test.clj +++ b/test/google_apps_clj/google_sheets_v4_test.clj @@ -10,6 +10,7 @@ (deftest test-cell-conversion (is (= "foo" (cell->clj "foo"))) (is (= 2.0 (cell->clj 2.0))) + (is (= true (cell->clj true))) (is (= (time/date-time 1950 6 15) (cell->clj (time/date-time 1950 6 15)))) (is (= "foo" (cell->clj (coerce-to-cell "foo"))))