class CWB::PSI
Class to parse the PSI
data
Attributes
dataid[R]
Public Class Methods
instant_psi()
click to toggle source
# File lib/weatai/cwb_psi.rb, line 13 def self.instant_psi raw_info = CWB::CWBApi.raw_info3(@dataid) all_location3 = {} raw_info['AQX']['Data'].each do |item| location = {} place = item['County'] location['city'] = item['County'] location['PSI'] = item['PSI'] location['Status'] = item['Status'] all_location3.store(place, location) end all_location3 end
new(dataid:)
click to toggle source
# File lib/weatai/cwb_psi.rb, line 9 def initialize(dataid:) @dataid = dataid end
Public Instance Methods
weather_test()
click to toggle source
# File lib/weatai/cwb_psi.rb, line 27 def weather_test return 'weather_test_yes' end