module ChinaAqi

Constants

VERSION

Public Class Methods

available_cities() click to toggle source
# File lib/china_aqi/helper/available_cities.rb, line 6
def available_cities
  AvailableCities.new.get
end
get_stations_for_city(city) click to toggle source

create a helper in ChinaAqi module

# File lib/china_aqi/helper/city_stations.rb, line 8
def get_stations_for_city(city)
  CityStations.new(city).get
end
token() click to toggle source
# File lib/china_aqi.rb, line 3
def self.token
  @token ||= begin
    if Module.const_defined?('Rails')
      Rails.application.config.china_aqi_token if Rails.application.config.respond_to?(:china_aqi_token)
    end
  end
end
token=(token_string) click to toggle source
# File lib/china_aqi.rb, line 11
def self.token=(token_string)
  @token = token_string
end

Private Instance Methods

available_cities() click to toggle source
# File lib/china_aqi/helper/available_cities.rb, line 6
def available_cities
  AvailableCities.new.get
end
get_stations_for_city(city) click to toggle source

create a helper in ChinaAqi module

# File lib/china_aqi/helper/city_stations.rb, line 8
def get_stations_for_city(city)
  CityStations.new(city).get
end