amadeus 1.0.0.beta3 → 1.0.0.beta4
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 +7 -7
- data/amadeus.gemspec +2 -1
- data/lib/amadeus/namespaces/reference_data.rb +13 -7
- data/lib/amadeus/namespaces/shopping.rb +3 -3
- data/lib/amadeus/namespaces/shopping/hotel.rb +3 -3
- data/lib/amadeus/namespaces/shopping/hotel/offer.rb +0 -7
- data/lib/amadeus/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 183aeaa0bf54b520b6b8df046c6522d6291a52eba37dcc5589575f0190820c87
|
4
|
+
data.tar.gz: 845ceff1e75f4f35a6c820812edfc1a281e051a9c1baaec48282e6e0b11e92e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e51e325256ef2871f3f59c4a40fb2a8c3250ec4581d7824673ecb241c83e2fc8eb7d80a547f973e38de231b024355404399374367f420666226ca305629d9c1
|
7
|
+
data.tar.gz: 0b7180dc22ccd22b7d35ae1c11f35bec498b5f629797fc890f9c8a5443f0c65e8e318727c051284e09e3201ea46967d194f68f90b4fe6b7669167d1e3607efd1
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Amadeus Ruby SDK
|
2
2
|
|
3
|
-
[]
|
3
|
+
[][gem]
|
4
4
|
[][travis]
|
5
5
|
[](https://codeclimate.com/github/amadeus4dev/amadeus-ruby/maintainability)
|
6
|
-
[](gem)
|
7
|
+
[][support]
|
8
8
|
|
9
9
|
Amadeus provides a set of APIs for the travel industry. Flights, Hotels, Locations and more.
|
10
10
|
|
@@ -15,7 +15,7 @@ For more details see the [Ruby documentation](https://developer.amadeus.com/docs
|
|
15
15
|
This gem requires Ruby 2.2+. You can install install it directly or via bundler.
|
16
16
|
|
17
17
|
```rb
|
18
|
-
gem 'amadeus'
|
18
|
+
gem 'amadeus', '~> 1.0.0.beta4'
|
19
19
|
```
|
20
20
|
|
21
21
|
__Next__: [Get Started with the Ruby SDK.](https://developer.amadeus.com/docs/ruby/get_started/initialize)
|
@@ -91,12 +91,12 @@ For example, `GET /v2/reference-data/urls/checkin-links?airline=1X` would be:
|
|
91
91
|
amadeus.reference_data.urls.checkin_links.get(airline: '1X')
|
92
92
|
```
|
93
93
|
|
94
|
-
Similarly, to select a resource by ID, you can pass in the ID to the path.
|
94
|
+
Similarly, to select a resource by ID, you can pass in the ID to the **singular** path.
|
95
95
|
|
96
|
-
For example, `GET /v1/shopping/hotel/123/
|
96
|
+
For example, `GET /v1/shopping/hotel/123/offers/234` would be:
|
97
97
|
|
98
98
|
```rb
|
99
|
-
amadeus.
|
99
|
+
amadeus.hotel(123).offer(234).get(...)
|
100
100
|
```
|
101
101
|
|
102
102
|
You can make any arbitrary API call as well directly with the `.get` method:
|
data/amadeus.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.license = 'MIT'
|
19
19
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
21
|
-
f.match(/^(test|spec|features|.github|docs|.gitignore|.rspec)/) ||
|
21
|
+
f.match(/^(test|spec|features|.github|docs|doc|.gitignore|.rspec)/) ||
|
22
22
|
f.match(/^(.rubocop.yml|.simplecov|.travis.yml|.yardopts)/) ||
|
23
23
|
f.match(/^(CODE_OF_CONDUCT|Rakefile|Guardfile|Gemfile)/)
|
24
24
|
end
|
@@ -38,4 +38,5 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_development_dependency 'simplecov', '~> 0.15'
|
39
39
|
spec.add_development_dependency 'vcr', '~> 4.0'
|
40
40
|
spec.add_development_dependency 'webmock', '~> 3.3'
|
41
|
+
spec.add_development_dependency 'yard', '~> 0.9.12'
|
41
42
|
end
|
@@ -23,18 +23,24 @@ module Amadeus
|
|
23
23
|
|
24
24
|
# The namespace for the Locations APIs:
|
25
25
|
#
|
26
|
-
# @param [Number] location_id The optional ID for the location
|
27
26
|
# @return [Amadeus::Namespaces::ReferenceData::Locations]
|
28
27
|
# @example
|
29
28
|
# amadeus.reference_data.locations
|
30
29
|
# amadeus.reference_data.locations.airports
|
31
30
|
#
|
32
|
-
def locations
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
def locations
|
32
|
+
Amadeus::Namespaces::ReferenceData::Locations.new(client)
|
33
|
+
end
|
34
|
+
|
35
|
+
# The namespace for the Location APIs - accessing a specific location
|
36
|
+
#
|
37
|
+
# @param [Number] location_id The ID for the location
|
38
|
+
# @return [Amadeus::Namespaces::ReferenceData::Locations]
|
39
|
+
# @example
|
40
|
+
# amadeus.reference_data.location('ALHR')
|
41
|
+
#
|
42
|
+
def location(location_id)
|
43
|
+
Amadeus::Namespaces::ReferenceData::Location.new(client, location_id)
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
@@ -54,11 +54,11 @@ module Amadeus
|
|
54
54
|
# The namespace for the Hotels API:
|
55
55
|
#
|
56
56
|
# @param [Number] hotel_id The ID for the hotel to find offers for
|
57
|
-
# @return [Amadeus::Namespaces::Shopping::
|
57
|
+
# @return [Amadeus::Namespaces::Shopping::Hotel]
|
58
58
|
# @example
|
59
|
-
# amadeus.shopping.
|
59
|
+
# amadeus.shopping.hotel(hotel_id)
|
60
60
|
#
|
61
|
-
def
|
61
|
+
def hotel(hotel_id)
|
62
62
|
Amadeus::Namespaces::Shopping::Hotel.new(client, hotel_id)
|
63
63
|
end
|
64
64
|
end
|
@@ -31,9 +31,9 @@ module Amadeus
|
|
31
31
|
# @param [Number] offer_id The ID for the offer to find details for
|
32
32
|
# @return [Amadeus::Namespaces::Shopping::Hotels::Offers]
|
33
33
|
# @example
|
34
|
-
# amadeus.shopping.
|
34
|
+
# amadeus.shopping.hotel('SMPARCOL').offer(234)
|
35
35
|
#
|
36
|
-
def
|
36
|
+
def offer(offer_id)
|
37
37
|
Amadeus::Namespaces::Shopping::Hotel::Offer.new(
|
38
38
|
client, @hotel_id, offer_id
|
39
39
|
)
|
@@ -43,7 +43,7 @@ module Amadeus
|
|
43
43
|
#
|
44
44
|
# @return [Amadeus::Namespaces::Shopping::Hotels::HotelOffers]
|
45
45
|
# @example
|
46
|
-
# amadeus.shopping.
|
46
|
+
# amadeus.shopping.hotel('SMPARCOL').hotel_offers
|
47
47
|
#
|
48
48
|
def hotel_offers
|
49
49
|
Amadeus::Namespaces::Shopping::Hotel::HotelOffers.new(
|
@@ -40,13 +40,6 @@ module Amadeus
|
|
40
40
|
# .offers('AC7D4DA2C322A73AF0824318A4965DA2805A3FC2').get
|
41
41
|
#
|
42
42
|
def get(params = {})
|
43
|
-
@offer_id ||= begin
|
44
|
-
offer_id = params[:id] || params['id']
|
45
|
-
params.delete(:id)
|
46
|
-
params.delete('id')
|
47
|
-
offer_id
|
48
|
-
end
|
49
|
-
|
50
43
|
client.get(
|
51
44
|
"/v1/shopping/hotels/#{@hotel_id}/offers/#{@offer_id}", params
|
52
45
|
)
|
data/lib/amadeus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amadeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amadeus
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-03-
|
12
|
+
date: 2018-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: awesome_print
|
@@ -165,6 +165,20 @@ dependencies:
|
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '3.3'
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: yard
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - "~>"
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: 0.9.12
|
175
|
+
type: :development
|
176
|
+
prerelease: false
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - "~>"
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: 0.9.12
|
168
182
|
description: |2
|
169
183
|
Ruby library for the Amadeus travel APIs, providing hotel, flight, airport,
|
170
184
|
and other travel related APIs.
|