weather-report 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e40fcae0d080a18d08175ed911738a01caaff265
4
- data.tar.gz: cec9d9bd30cdf41f4533cd4a327097372cacbf47
3
+ metadata.gz: 760746840f014f0120e729148e4f61516212875f
4
+ data.tar.gz: 1ceb9967c055c7b6a89fa90de5168eeef1f0ab91
5
5
  SHA512:
6
- metadata.gz: 1931597a94a6bfba4666ea5703397826a8f9b244944fa88a2641a971a0ac6c39ccb45339025c0a794029c4b7833cffc434fe3dc3165f0057ed55ddfe8577cf67
7
- data.tar.gz: 5e06046a028d6294de4e0cd680fd05953045d3b7d5a921adeb2d84d337aaba10c35613f861aa094b968b2932344d9c6a77cb75184d9373669654419fc1ae5b57
6
+ metadata.gz: 0ae3d76979a77a7519ca8153b2a2706af9a7e65686bf1bb282801f1c4f6de8c9fbea9483f5fca14456990afa6f704166a9415fc3c900104fe4012c7a66e10d31
7
+ data.tar.gz: 52938d64da714d90db1e8dcf7aa52f360bff6e24c3446cf2703466cc7dac0a5f255e778e86c9cbe990942aed7f9a17a0703dbfa99d98420816950e60e9cc4c01
@@ -8,21 +8,27 @@ module WeatherReport
8
8
  @forecast = forecast(forecasts, dateLabel)
9
9
  end
10
10
 
11
+ # @return [Date] the date
11
12
  def date
12
13
  year, month, day = @forecast["date"].split('-')
13
14
  @date ||= Date.new(year.to_i, month.to_i, day.to_i)
14
15
  end
15
16
 
17
+ # @return [String] the telop
16
18
  def telop
17
19
  @telop ||= @forecast["telop"]
18
20
  end
19
21
 
22
+ # @return [Fixnum] the minimum temperature.
23
+ # Temperature of today could be nil.
20
24
  def temperature_min
21
25
  min = @forecast["temperature"]["min"]
22
26
  @temperature ||=
23
27
  min ? min["celsius"].to_i : nil
24
28
  end
25
29
 
30
+ # @return [Fixnum] the maximum temperature.
31
+ # Temperature of today could be nil.
26
32
  def temperature_max
27
33
  max = @forecast["temperature"]["max"]
28
34
  @temperature_max ||=
@@ -1,3 +1,3 @@
1
1
  module WeatherReport
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -8,6 +8,7 @@ module WeatherReport
8
8
  @uri = URI.parse("http://weather.livedoor.com/forecast/webservice/json/v1?city=#{city_id}")
9
9
  end
10
10
 
11
+ # @return [String] the id of given city
11
12
  def self.request_cityid(city)
12
13
  doc = Nokogiri::XML(open("http://weather.livedoor.com/forecast/rss/primary_area.xml"))
13
14
  doc.search("//city[@title='#{city}']").attr("id").value
@@ -15,14 +16,17 @@ module WeatherReport
15
16
  raise WeatherReportError
16
17
  end
17
18
 
19
+ # @return [Day] the today
18
20
  def today
19
21
  @today ||= Day.new(forecasts, "今日")
20
22
  end
21
-
23
+
24
+ # @return [Day] the tomorrow
22
25
  def tomorrow
23
26
  @tomorrow ||= Day.new(forecasts, "明日")
24
27
  end
25
28
 
29
+ # @return [Day] the day after tomorrow
26
30
  def day_after_tomorrow
27
31
  @day_after_tomorrow ||= Day.new(forecasts, "明後日")
28
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weather-report
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
  - zakuni