darksky_ruby_client 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/darksky_ruby_client/client.rb +3 -3
- data/lib/darksky_ruby_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f50f7c621b6b8bf0ba6ff2dbd55bc3e1cc4d0df6
|
4
|
+
data.tar.gz: 1d29c79687153daafca6a546d6b14c8e75ee17a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5a4d5ce1039eaca500bc06ce5093b97bf35ee79e24227f3ef7dc83cafa5e5d2684650e76b12052273e53c68ab3d9bd8ed0f744947c911bda8042edfbfafecae
|
7
|
+
data.tar.gz: 3bdd10f63e4527afb8cf383c4e3ffab991b93f7a97ce87331f4bd85b88935a4f7439f6bcf73eb7b9457badecd4c8ceb1a2dc227a64f06377c139a7e38864c97e
|
data/README.md
CHANGED
@@ -23,7 +23,14 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
## Usage
|
25
25
|
|
26
|
-
|
26
|
+
```ruby
|
27
|
+
require 'darksky_ruby_client'
|
28
|
+
options = {
|
29
|
+
:extend => "hourly"
|
30
|
+
}
|
31
|
+
client = DarkskyRubyClient::Client.new('your Dark Sky secret key')
|
32
|
+
client.weather_forecast('latitude', 'longitude', options).run
|
33
|
+
```
|
27
34
|
|
28
35
|
## Development
|
29
36
|
|
@@ -66,15 +66,15 @@ module DarkskyRubyClient
|
|
66
66
|
# * si: SI units
|
67
67
|
# Please check with https://darksky.net/dev/docs#forecast-request for available SI units.
|
68
68
|
def weather_forecast(lat, long, options = {})
|
69
|
-
@request_url
|
69
|
+
@request_url = @@base_url + @secret_key + '/' + lat + ',' + long + '/'
|
70
70
|
unless options.empty? then
|
71
71
|
options.each {|key, value|
|
72
72
|
if [:exclude, :extend, :lang, :units].include?(key)
|
73
73
|
p @request_url[-1]
|
74
74
|
if @request_url[-1] == '/'
|
75
|
-
@request_url
|
75
|
+
@request_url = '?' + key.to_s + '=' + value
|
76
76
|
else
|
77
|
-
@request_url
|
77
|
+
@request_url = '&' + key.to_s + '=' + value
|
78
78
|
end
|
79
79
|
else
|
80
80
|
@log.warn("invalid options key \"#{key}\".")
|