wwo 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wwo.rb +12 -3
  3. data/lib/wwo/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde78b945408af8d30ac20e5f143dd502ce82a05
4
- data.tar.gz: 7e5592d90c69813fb4528ccb8d4b7b41d9c9bf06
3
+ metadata.gz: 70fa3eddb446689e3a6876bb42ef1b9c970d03ef
4
+ data.tar.gz: 860cf5e6b71dcd1d0c7f1643366383beaf5f1553
5
5
  SHA512:
6
- metadata.gz: e324fc63f41c1f25776767906520e0a2fdbae799cf419f97976cfc1018aae624e2c3ea8dc323089dfb614faf43cd6ee0da1d956c7a5a14434defdac909111fe1
7
- data.tar.gz: 8d2f67cfc46b68d1cd8e97ce09027a52e6f972f71498a0dc00f61c600cc4484748aae44c99d49e5c056172ff6cf2d19cca11bdfab6832a22e1046dd3feb370e7
6
+ metadata.gz: 0b4d9b2d4a56782e86ea11d69502ac2bd4cb0416fa5bfe1599c3f2e4bc5b8a63e7dd6217433eee82016ed46b17d75e95e01d8e4a82e5b69c80a1b809f521b7a9
7
+ data.tar.gz: b0608c47c517ca4791ddf23f952bba597995582bc94c2d148141280d63230ab24071fc92342549c5c992d74dffe11ceecced12fc86d096771487204d8ebd6782
data/lib/wwo.rb CHANGED
@@ -46,7 +46,7 @@ module Wwo
46
46
  api_response = get(uri)
47
47
 
48
48
  if api_response.success?
49
- return Hashie::Mash.new(MultiJson.load(api_response.body))
49
+ return parse_response(Hashie::Mash.new(MultiJson.load(api_response.body)))
50
50
  end
51
51
  end
52
52
 
@@ -64,7 +64,7 @@ module Wwo
64
64
  api_response = get(uri)
65
65
 
66
66
  if api_response.success?
67
- return Hashie::Mash.new(MultiJson.load(api_response.body))
67
+ return parse_response(Hashie::Mash.new(MultiJson.load(api_response.body)))
68
68
  end
69
69
  end
70
70
 
@@ -85,8 +85,17 @@ module Wwo
85
85
 
86
86
  def get(path, params = {})
87
87
  params = Wwo.default_params.merge(params || {})
88
-
89
88
  connection.get(path, params)
90
89
  end
90
+
91
+ # Munges the repsonse into one like what we would expect from Forecast.io
92
+ #
93
+ def parse_response(response)
94
+ data = { daily: { data: [ { icon: '', 'temperatureMax' => 0, 'temperatureMin' => 0 } ] } }
95
+ data[:daily][:data][0][:icon] = response.data.weather.first.hourly.first.weatherIconUrl.first.value
96
+ data[:daily][:data][0]['temperatureMax'] = response.data.weather.first.maxtempC
97
+ data[:daily][:data][0]['temperatureMin'] = response.data.weather.first.mintempC
98
+ data
99
+ end
91
100
  end
92
101
  end
data/lib/wwo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wwo
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wwo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "株式会社アルム Allm Inc"