getyourguide 0.0.4 → 0.1.0
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/lib/getyourguide.rb +1 -0
- data/lib/getyourguide/models/image.rb +12 -0
- data/lib/getyourguide/parsers/default.rb +14 -3
- data/lib/getyourguide/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5224de588ef66eaecc58981e13c4f95e9d3ffc4f
|
4
|
+
data.tar.gz: 183d9d3046121a8e95cbb7f2ba2f09f47a9ce2a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9055a0624d8e434ba6094f4e103f7222ab87b244226af9923f28d87595b7aa6e4fc64ee885119fa48437b213b7d26143e6fb4561259e4693fd4189bbb9db942
|
7
|
+
data.tar.gz: 77b1228e640ce7cc6c4abcc891724c8f0a340fd4290fdaaf69abbfbc07a1aa04e2c2200903953c71d5c10afaf0dba34f2924e02d55bf551de58adcd0cc49d822
|
data/lib/getyourguide.rb
CHANGED
@@ -7,6 +7,7 @@ require "GetYourGuide/errors/api_error"
|
|
7
7
|
require "GetYourGuide/models/activity"
|
8
8
|
require "GetYourGuide/models/category"
|
9
9
|
require "GetYourGuide/models/destination"
|
10
|
+
require "GetYourGuide/models/image"
|
10
11
|
require "GetYourGuide/models/image_format"
|
11
12
|
require "GetYourGuide/models/location"
|
12
13
|
require "GetYourGuide/models/top_category"
|
@@ -39,16 +39,27 @@ module GetYourGuide
|
|
39
39
|
categories
|
40
40
|
end
|
41
41
|
|
42
|
-
def get_pictures_list(
|
42
|
+
def get_pictures_list(pictures_xml)
|
43
43
|
pictures = []
|
44
44
|
|
45
|
-
|
46
|
-
|
45
|
+
pictures_xml.xpath('pictures').children.children.each do |picture|
|
46
|
+
unless picture.inner_text == ''
|
47
|
+
picture_attributes = {
|
48
|
+
:ssl => to_boolean(picture.attr('ssl')),
|
49
|
+
:url => picture.inner_text
|
50
|
+
}
|
51
|
+
|
52
|
+
pictures << GetYourGuide::Models::Image.new(picture_attributes)
|
53
|
+
end
|
47
54
|
end
|
48
55
|
|
49
56
|
pictures
|
50
57
|
end
|
51
58
|
|
59
|
+
def to_boolean(input)
|
60
|
+
input == 'true'
|
61
|
+
end
|
62
|
+
|
52
63
|
def get_indivative_price(product_xml)
|
53
64
|
product_xml.xpath('price').children.first.children.each do |price|
|
54
65
|
return price.children.inner_text.to_f if price.attr('currency') == 'EUR'
|
data/lib/getyourguide/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getyourguide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Delhaye
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/getyourguide/models/activity.rb
|
102
102
|
- lib/getyourguide/models/category.rb
|
103
103
|
- lib/getyourguide/models/destination.rb
|
104
|
+
- lib/getyourguide/models/image.rb
|
104
105
|
- lib/getyourguide/models/image_format.rb
|
105
106
|
- lib/getyourguide/models/location.rb
|
106
107
|
- lib/getyourguide/models/top_category.rb
|