skiplan_client 0.2.2 → 0.2.3

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: 496d00698f96f630128ff4a9918df9a66b0bff9a
4
- data.tar.gz: c6c09193f4a2f2467faccc691d9729b12ba0e812
3
+ metadata.gz: 94773202512f28a9b5ec221e91ebb45151f3bb4d
4
+ data.tar.gz: a8bfcec5b4e3959556bbbc4998475adb0410ad47
5
5
  SHA512:
6
- metadata.gz: 93fbbea408b667cd68adf49f893ad7b2d3511365cf7be8ea2f33f2abd6f49ff4e4bd753847e841d6e3dd326c77312d274cf8c62fbe9ad451307c0c851ed40495
7
- data.tar.gz: b855c27449b4c3a21f2f3656f74d53bca05603cf66d10616302c81a750d2b68fc04709c858b1d4bea1a65502bc290e853e54a01580fc391727dd4921a4385ac0
6
+ metadata.gz: fae8e1a71257d9ed055592f5bc7f8ec1a835027c5e79b5fa8084d710f0312dc22454afa416d54214daa2984e599288f0470f4cadee3589f75bbf6ad2b14afa30
7
+ data.tar.gz: 3ea1a3c7d5a1c195a68c991e2f19ff5228d5b5dc4a1e2f39994269bd67d93516a71261f67c6f73fcb5b3aaf7229182dfbc92f64bfca7664d9fcbadcf61540f3b
@@ -565,6 +565,13 @@
565
565
  <PLAGE prd_id="4" pgh_id="" heuredeb="" heurefin=""/>
566
566
  </PLAGES>
567
567
  </PISTE>
568
+ <Liaison nom="FICTIVE" etat="O">
569
+ <PLAGES>
570
+ <PLAGE ent_id="1" prd_id="1" pgh_id="1" heuredeb="09:25" heurefin="16:35"/>
571
+ <PLAGE ent_id="1" prd_id="2" pgh_id="1" heuredeb="09:25" heurefin="16:35"/>
572
+ <PLAGE ent_id="1" prd_id="3" pgh_id="1" heuredeb="09:25" heurefin="16:35"/>
573
+ </PLAGES>
574
+ </Liaison>
568
575
  </SECTEUR>
569
576
  <SECTEUR nom="ALPIN JOYERE">
570
577
  <REMONTEE nom="TC LA JOYERE" etat="F" type="TC" msg="Ferm??e pour la saison " attente="0" longueur="0" heuredeb="00:00" heurefin="23:59" heuredebmod="00:00" heurefinmod="23:59">
@@ -1,3 +1,3 @@
1
1
  module SkiplanClient
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -8,6 +8,7 @@ class Zone
8
8
  normalized_attrs = attributes.dup
9
9
  normalized_attrs['REMONTEE'] = [normalized_attrs['REMONTEE']] if normalized_attrs['REMONTEE'].is_a?(Hash)
10
10
  normalized_attrs['PISTE'] = [normalized_attrs['PISTE']] if normalized_attrs['PISTE'].is_a?(Hash)
11
+ normalized_attrs['Liaison'] = [normalized_attrs['Liaison']] if normalized_attrs['Liaison'].is_a?(Hash)
11
12
  self.attributes = normalized_attrs
12
13
  end
13
14
 
@@ -23,6 +24,10 @@ class Zone
23
24
  @PISTE
24
25
  end
25
26
 
27
+ def connections
28
+ @Liaison
29
+ end
30
+
26
31
  def ratio(array_field = [])
27
32
  open_entries = array_field.select {|r| r['etat'] == 'O'}
28
33
  "#{open_entries.length}/#{array_field.length}"
@@ -71,6 +71,7 @@ class SkiplanClientTest < Test::Unit::TestCase
71
71
  ac_zone = zones['ALPIN CHINAILLON']
72
72
  assert_equal 10, ac_zone.skilifts.count
73
73
  assert_equal 16, ac_zone.slopes.count
74
+ assert_equal 1, ac_zone.connections.count
74
75
 
75
76
  single_entry_zone = zones['PIETONS']
76
77
  assert_equal 1, single_entry_zone.slopes.count
@@ -11,7 +11,9 @@ class ZoneTest < Test::Unit::TestCase
11
11
  'REMONTEE' => [{'nom' => 'TS LA FLORIA', 'etat' => 'O', 'type' => 'TS', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:45'},
12
12
  {'nom' => 'TK LE STADE', 'etat' => 'F', 'type' => 'TK', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:00'}],
13
13
  'PISTE' => [{'nom' => 'LA SERPENTINE', 'etat' => 'F', 'type' => 'A', 'msg' => 'Piste de retour au Village', 'niveau' => 'V', 'entretien_num' => '1'},
14
- {'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}]
14
+ {'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}],
15
+ 'Liaison' => [{'nom' => 'DOUCYCOMBELOUVIERE', 'etat' => 'F'}, {'nom' => 'ST FRANCOIS', 'etat' => 'O'}]
16
+
15
17
  }
16
18
  @zone = Zone.new(attributes)
17
19
  end
@@ -22,6 +24,7 @@ class ZoneTest < Test::Unit::TestCase
22
24
  {'nom' => 'TK LE STADE', 'etat' => 'F', 'type' => 'TK', 'msg' => 'Fermee pour la saison', 'heuredeb' => '09:00', 'heurefin' => '16:00'}], @zone.skilifts
23
25
  assert_equal [{'nom' => 'LA SERPENTINE', 'etat' => 'F', 'type' => 'A', 'msg' => 'Piste de retour au Village', 'niveau' => 'V', 'entretien_num' => '1'},
24
26
  {'nom' => 'LE VENAY', 'etat' => 'O', 'type' => 'A', 'msg' => '', 'niveau' => 'V', 'entretien_num' => '0'}], @zone.slopes
27
+ assert_equal [{'nom' => 'DOUCYCOMBELOUVIERE', 'etat' => 'F'}, {'nom' => 'ST FRANCOIS', 'etat' => 'O'}], @zone.connections
25
28
  end
26
29
 
27
30
  should 'store an array of slopes even when only one slope is present' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skiplan_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SimonRonzani
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-02 00:00:00.000000000 Z
12
+ date: 2015-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler