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 inherited from Base

get

Methods included from Utility

#get, #uri, #url

Constructor Details

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

Returns a new instance of DynamicBase.



67
68
69
70
71
# File 'lib/china_aqi/base.rb', line 67

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.



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

def city
  @city
end