Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

global_weather

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global_weather

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GlobalWeather

Global Weather SOAP service ruby wrapper.

Installation

Add this line to your application's Gemfile:

gem 'global_weather'

And then execute:

$ bundle

Or install it yourself as:

$ gem install global_weather

This gem was tested on ruby 1.9.3p327

Usage

Basically GlobalWeather gem provides 2 classes Country (wraps GetCitiesByCountry soap method call) and Weather (wraps GetWeather method call)

To get cities by country (e.g. Germany)

  country = GlobalWeather::Country.new 'Germany'
 
  country.cities # returns an array of strings

In order to get current weather (e.g. country 'Germany', city 'Berlin')

  weather = GlobalWeather::Weather.new 'Germany', 'Berlin' 
   
  puts weather.time[:UTC]

  puts weather.temperature[:C]

  puts weather.temperature[:F]

  puts weather.pressure[:Hg]

  puts weather.pressure[:hPa]

See full list of attributes

  GlobalWeather::Weather::ATTRIBUTES

Can it be simplier?

Test

Command

$ rake

or

$ rake test

will run all tests

Configuration

There is only one client instance shared among all instances of GlobalWeather Weather and Country objects.

GlobalWeather::Client.configure do |config| config.log false config.proxy 'http://my_company_internal_proxy' end

options provided this way will be passed futher down to Savon.client. See full list of all at savon documentation

FAQs

Package last updated on 26 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc