Class: ChinaAqi::Station
Overview
Fetch data for one monitoring station
example:
ChinaAqi::Station.new('1141A').get
same as:
ChinaAqi::Station.get(station_code)
You can get all station codes for one city like this:
ChinaAqi::Station.new(station_code).get
or like this:
ChinaAqi.get_stations_for_city(city)
and like this:
ChinaAqi::Station.get(city)
Instance Attribute Summary collapse
-
#station_code ⇒ Object
Returns the value of attribute station_code.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(station_code) ⇒ Station
constructor
A new instance of Station.
Methods inherited from Base
Methods included from Utility
Constructor Details
#initialize(station_code) ⇒ Station
Returns a new instance of Station.
27 28 29 30 31 |
# File 'lib/china_aqi/aqi/station.rb', line 27 def initialize(station_code) super @station_code = station_code @parmas = { station_code: station_code, token: ChinaAqi.token } end |
Instance Attribute Details
#station_code ⇒ Object
Returns the value of attribute station_code.
25 26 27 |
# File 'lib/china_aqi/aqi/station.rb', line 25 def station_code @station_code end |