module PurpleAirApi

The PurpleAirApi is a gem intended to be used to interact with the PurpleAir API easily.

Constants

VERSION

The gem version

Public Class Methods

client(read_token:, write_token: nil) click to toggle source

Alias for PurpleAirApi::V1::Client.new

@return [PurpleAirApi::V1::Client] @example requesting data for a few sensors

options = { fields: ['icon', 'name'], location_type: ['outside'], show_only: [26, 41], max_age: 3600}
PurpleAirApi.client(read_token: "1234", write_token: "1234").request_sensors(options)
# File lib/purple_air_api.rb, line 22
def self.client(read_token:, write_token: nil)
  PurpleAirApi::V1::Client.new(read_token: read_token, write_token: write_token)
end
method_missing(method, *args, &block) click to toggle source

Delegate to PurpleAirApi::V1::Client

Calls superclass method
# File lib/purple_air_api.rb, line 27
def self.method_missing(method, *args, &block)
  return super unless client.respond_to?(method)

  client.send(method, *args, &block)
end
respond_to?(method, include_all: false) click to toggle source

Delegate to PurpleAirApi::V1::Client

Calls superclass method
# File lib/purple_air_api.rb, line 34
def self.respond_to?(method, include_all: false)
  client.respond_to?(method, include_all) || super
end
respond_to_missing?(method_name, include_private: false) click to toggle source

Delegate to PurpleAirApi::V1::Client

Calls superclass method
# File lib/purple_air_api.rb, line 39
def self.respond_to_missing?(method_name, include_private: false)
  client.respond_to_missing?(method_name, include_private) || super
end