MexWeather 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/mex_weather.rb +18 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 162f4e9b7f76969d99224abedad633ba194d8271
|
4
|
+
data.tar.gz: 9f8bc4de29eae80b8d2d48f4cea8850d153f502b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7727efbcaa668f4f4368857e07a4263b46d6b7f1e0ee193083ad2ec5534caca2678d465dd824c90ecde12c50a4634bacb0bbc21bfd375815a19938479ce2ef1e
|
7
|
+
data.tar.gz: 4ac1d0417204cc135b9eea7a418f15985c799df2c1d02b73c8a654f749ed0ba5d0f918862088c21021926759fbf6670ba660cb1ec39881537bb60d2218cdadae
|
data/lib/mex_weather.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'httparty'
|
3
|
+
module MexWeather
|
4
|
+
|
5
|
+
#$weather_calculator = -> (city){ HTTParty.get("http://api.openweathermap.org/data/2.5/weather?q=#{city},mx").parsed_response["main"]}
|
6
|
+
|
7
|
+
class Weather
|
8
|
+
@@weather_calculator = -> (city){ HTTParty.get("http://api.openweathermap.org/data/2.5/weather?q=#{city},mx").parsed_response["main"]}
|
9
|
+
|
10
|
+
def self.get_weather_for(city)
|
11
|
+
weather = @@weather_calculator.call city
|
12
|
+
{ actual: weather["temp"] - 273.15, maxima: weather["temp_max"] - 273.15, minima: weather["temp_min"] - 273.15 }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
#clima = MexWeather::Weather.get_weather_for 'chihuahua'
|
18
|
+
#puts "Actual: #{clima[:actual]} Maxima: #{clima[:maxima]} Minima: #{clima[:minima]}"
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: MexWeather
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rolando Vazquez
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Una gema para obtener la temperatura por ciudad, para ciudades en Mexico
|
14
|
+
email: rivazquez@uach.mx
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/mex_weather.rb
|
20
|
+
homepage: http://rolascloud.com
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.0.3
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Weather
|
44
|
+
test_files: []
|