fix: check if country is available
This commit is contained in:
@ -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?
|
||||
|
||||
Reference in New Issue
Block a user