Skip to content

tiagoleal/OpenWeatherMap-sdk

Repository files navigation

The OpenWeatherMap-sdk Ruby gem

Current Version Ruby Version

A Ruby interface to the Openweather API.

Installation

Add this line to your application's Gemfile:

gem 'OpenWeatherMap', git: 'https://github.com/tiagoleal/OpenWeatherMap-sdk.git'

And then execute:

$ bundle install

Examples files

https://github.com/tiagoleal/OpenWeatherMap-sdk/tree/master/examples

Usage Examples

After create a token OpenweatherMap Api, you can do the following things.

OpenWeatherMap (show the current forecast)

#id: Your token OpenWeatherMap API (https://openweathermap.org/api)
#city: desired city (optional parameter)
#default city='Santa Cruz do Sul'
client = OpenWeatherMap::Auth.new(id,'Santa Cruz do Sul')
client.current_forecast

OpenWeatherMap (show the next five days forecast)

#id: Your token OpenWeatherMap API (https://openweathermap.org/api)
#city: desired city (optional parameter)
#default city='Santa Cruz do Sul'
client = OpenWeatherMap::Auth.new(id,'Santa Cruz do Sul')
client.next_five_forecast

OpenWeatherMap (show the current and next five days forecast)

#id: Your token OpenWeatherMap API (https://openweathermap.org/api)
#city: desired city (optional parameter)
#default city='Santa Cruz do Sul'
client = OpenWeatherMap::Auth.new(id)
client.complete_forecast

Running tests

OpenweatherMap-sdk uses Rspec as test framework.

  • Running all tests:
rspec spec
  • Running tests for an specific file:
rspec spec/OpenWeatherMap_spec.rb

Supported Ruby Versions

This library aims to support and is the following Ruby versions:

  • Ruby 2.6
  • Ruby 2.7

Authors


Tiago Leal

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tiagoleal/OpenWeatherMap-sdk.

License

The gem is available as open source under the terms of the MIT License.

About

Comunication OpenWeather API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages