2 Commits

Author SHA1 Message Date
fauno 07aca746a9 v0.5.3 2023-04-22 21:07:13 -03:00
fauno 8be1dbca5b fix: check if country is available 2023-04-22 21:05:32 -03:00
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: "access_log"
version: "0.5.1"
version: "0.5.3"
authors:
- "f <f@sutty.nl>"
targets:
+1 -1
View File
@@ -10,7 +10,7 @@ require "./models/access_log"
require "./models/crawler"
require "./swd"
VERSION = "0.5.2"
VERSION = "0.5.3"
Log.setup_from_env
+2 -2
View File
@@ -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?