From 8be1dbca5bda8123e33d5dc0b565d08bef3eb310 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 22 Apr 2023 21:05:32 -0300 Subject: [PATCH] fix: check if country is available --- src/swd/intensity_data.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/swd/intensity_data.cr b/src/swd/intensity_data.cr index 183f576..bd23ca6 100644 --- a/src/swd/intensity_data.cr +++ b/src/swd/intensity_data.cr @@ -9,13 +9,13 @@ class SWD # Return the marginal intensity for a country when provided an ISO # code def self.marginal_by_iso(iso : String) : Float64? - MARGINAL_INTENSITY_BY_ISO_CODE[iso] + MARGINAL_INTENSITY_BY_ISO_CODE[iso] if MARGINAL_INTENSITY_BY_ISO_CODE.has_key? iso end # Return the average intensity for a country when provided an ISO # code def self.average_by_iso(iso : String) : Float64? - AVERAGE_INTENSITY_BY_ISO_CODE[iso] + AVERAGE_INTENSITY_BY_ISO_CODE[iso] if AVERAGE_INTENSITY_BY_ISO_CODE.has_key? iso end def self.by_iso(iso : String, type : Symbol = :marginal) : Float64?