weatherzone 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,8 @@ module Weatherzone
28
28
  :surf_report => "surf_rpt=2",
29
29
  :climate_periods => "climate=1(months=12)",
30
30
  :related_locations => "locdet=1",
31
- :buoy_observations => "buoy=1(period=24)"
31
+ :buoy_observations => "buoy=1(period=24)",
32
+ :snow_reports => "snow=3"
32
33
  }
33
34
 
34
35
  def self.included(klass)
@@ -67,6 +68,12 @@ module Weatherzone
67
68
  find(connection, options)
68
69
  end
69
70
 
71
+ def find_snow_resort(connection, resort_code, options={})
72
+ options = options.dup
73
+ options.merge!(:params => "&lt=snow&lc=#{resort_code}")
74
+ find(connection, options)
75
+ end
76
+
70
77
  def find_by_location_filter(connection, filter, options={})
71
78
  options = options.dup
72
79
  options.merge!(:params => "&lt=twcid&lf=#{filter}")
@@ -2,4 +2,5 @@ class SnowReport < Weatherzone::Resource
2
2
  has_elements :day_name, :issue_time_local, :visibility_text, :road_conditions, :primary_surface, :snow_conditions, :snow_cover, :snow_depth_avg_cm, :snow_depth_new_cm,
3
3
  :snow_making, :grooming, :last_snowfall_date, :resort_summary, :lifts_open
4
4
  elements :lift, :as => :lifts, :class => Lift
5
+ elements :cam, :as => :cameras, :class => Camera
5
6
  end
data/lib/weatherzone.rb CHANGED
@@ -35,5 +35,5 @@ require 'weatherzone/helpers/date_parser'
35
35
  require 'weatherzone/helpers/units'
36
36
 
37
37
  module Weatherzone
38
- VERSION = '0.7.0'
38
+ VERSION = '0.7.1'
39
39
  end
@@ -18,6 +18,10 @@ class TestSnowReport < Test::Unit::TestCase
18
18
  assert @snow_report.lifts.any?
19
19
  end
20
20
 
21
+ def test_should_have_many_cameras
22
+ assert @snow_report.cameras.any?
23
+ end
24
+
21
25
  def test_should_not_have_nil_attributes
22
26
  [:day_name, :issue_time_local, :visibility_text, :road_conditions, :primary_surface, :snow_conditions, :snow_cover, :snow_depth_avg_cm, :snow_depth_new_cm,
23
27
  :snow_making, :grooming, :last_snowfall_date, :resort_summary, :lifts_open].each do |attr_name|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben Askins
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-21 00:00:00 +10:00
17
+ date: 2010-05-03 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency