Class: ChinaAqi::DynamicBase

Inherits:
Base
  • Object
show all
Defined in:
lib/china_aqi/base.rb

Overview

APIs with some parameters

Direct Known Subclasses

CO, City, CityPro, CityStations, NO2, O3, PM10, PM25, SO2

Instance Attribute Summary collapse

Attributes inherited from Base

#token

Instance Method Summary collapse

Methods included from Utility

#get, #uri, #url

Constructor Details

#initialize(city, querys = {avg: true, stations: :yes}) ⇒ DynamicBase

Returns a new instance of DynamicBase.



63
64
65
66
67
# File 'lib/china_aqi/base.rb', line 63

def initialize(city, querys = {avg: true, stations: :yes})
  super
  @city = city
  @parmas = querys.merge(city: city, token: ChinaAqi.token)
end

Instance Attribute Details

#cityObject

Returns the value of attribute city.



61
62
63
# File 'lib/china_aqi/base.rb', line 61

def city
  @city
end