RubyGem

Gannet

A RubyGem wrapper for the AirNow API, providing a simple and clean interface to retrieve air quality information and forecasts.

Gannet makes it easy for Ruby developers to integrate real-time air quality data into their applications. By wrapping the AirNow API, it provides intuitive methods for checking AQI levels and weather forecasts based on geographical location.

Features

  • API Integration: Provides Ruby methods that correspond directly to AirNow endpoints, such as forecast_zip_code.
  • Easy Configuration: Get started quickly by configuring your AirNow API key through a simple initializer.
  • Lightweight & Efficient: Uses httparty for robust and fast network requests.
  • Fully Tested: Built with a focus on reliability, featuring a comprehensive suite of RSpec tests.

Installation

Add this line to your application's Gemfile:

gem 'gannet'

And then execute:

bundle install

Usage

require 'gannet'
 
Gannet.configure do |config|
  config.api_key = 'YOUR_API_KEY'
end
 
# Get current air quality for a ZIP code
aqi = Gannet.current_zip_code('94103')
puts "Current AQI: #{aqi.first['AQI']}"