expedia_api 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b775cb669fbc7e21933c827b2f576308510b20fe
4
- data.tar.gz: 031b9e06e2b77ae18e583a50d7c0ad1371fbb99b
3
+ metadata.gz: 557dcad02c9d0ee37da7efc4dde94df088a8d6ec
4
+ data.tar.gz: 16bd2b9a9024a8bb9e3db4610e0fb40c91b3d04e
5
5
  SHA512:
6
- metadata.gz: a905024f1fe7eb4acc520ac59283037017122e7f1b5e4b957ade361207af61c6df969ddc416481d1db861dd1143a76ddc81cb69119542a1dfbda08c5e0261903
7
- data.tar.gz: ade3c780ba67e6465e94c39686fc4d0b4c82776baad4fd44afb973c5b01fb94d3e2b6f41b3673ea40cf5221b679b79c087c5a7a1391a2c45c9a4fe06a76e2aab
6
+ metadata.gz: 653c7dd90f805d67bab75c142c9d020df00737c780588c4f20f1c2505fce1934863248716cef27c6384997ce59263fed180e5acd07e53e6f9d40b5a55509037d
7
+ data.tar.gz: ec5d21508df926d51a626c87f2dc00e889e56605f1fca868ab49683188c3b4f13b43f8b2877d6d468339c203eac14e04cd329081f2abd0d2415fbcd016c1d96a
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -4,11 +4,15 @@ module ExpediaApi
4
4
  attr_reader :raw_data
5
5
 
6
6
  def initialize(raw_data)
7
- @raw_data = raw_data
7
+ @raw_data = raw_data || {}
8
8
  end
9
9
 
10
10
  def available?
11
- !!raw_data[:Price].fetch(:TotalRate, nil)
11
+ if raw_data[:Price]
12
+ !!raw_data[:Price].fetch(:TotalRate, nil)
13
+ else
14
+ false
15
+ end
12
16
  end
13
17
 
14
18
  def sold_out?
@@ -17,6 +17,14 @@ module ExpediaApi
17
17
  @entries.map(&:block)
18
18
  end
19
19
 
20
+ def first
21
+ @entries.first
22
+ end
23
+
24
+ def last
25
+ @entries.last
26
+ end
27
+
20
28
  def entries
21
29
  @entries
22
30
  end
@@ -1,3 +1,3 @@
1
1
  module ExpediaApi
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expedia_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hendrik Kleinwaechter