RDC 0.1.3 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/RDC.gemspec +1 -1
- data/lib/RDC/item.rb +4 -2
- data/lib/RDC/request.rb +2 -2
- data/lib/RDC/restaurant.rb +11 -1
- data/lib/RDC/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5e0ebf0eae847eed19c9288de8eca2b0597cf37574034642f634d616d22fb4c
|
4
|
+
data.tar.gz: 9e86822b647d9dbe384113d8797992f570d46e7ef7e5e174a9a331b51c27beca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69f6bc818f5697bfbe284e458fae908af44051ff749573442f7d0ca7e223e2f59bbd1b38c92176c49a606ec20e3f249424c9bfa25d686d3c80bd0f1b2345e392
|
7
|
+
data.tar.gz: 7f2adcafe024b85ea0cc767f3fe9be98aa808fd1921a6c1a03143b442bdaa5ce5af9e69fbc3bba647ec2f67fd98777a2586e9cb654ff8b4e7b7a24e4da0a908a
|
data/Gemfile.lock
CHANGED
data/RDC.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ['lib']
|
30
30
|
|
31
|
-
spec.add_dependency 'activesupport'
|
31
|
+
spec.add_dependency 'activesupport'
|
32
32
|
spec.add_dependency 'net-sftp', '3.0.0'
|
33
33
|
spec.add_dependency 'rubyzip'
|
34
34
|
end
|
data/lib/RDC/item.rb
CHANGED
@@ -2,16 +2,18 @@
|
|
2
2
|
|
3
3
|
module RDC
|
4
4
|
class Item
|
5
|
-
attr_accessor :sku, :legacy_sku, :value, :price, :restriction, :restriction_detail
|
5
|
+
attr_accessor :sku, :legacy_sku, :value, :price, :restriction, :restriction_detail,
|
6
|
+
:available_inventory, :item_contract_type
|
6
7
|
|
7
8
|
def initialize(hash_values)
|
8
|
-
puts "Hash Values :: #{hash_values}"
|
9
9
|
@sku = hash_values['ProductSKU']
|
10
10
|
@legacy_sku = hash_values['LegacyProductSKU']
|
11
11
|
@value = hash_values['ItemValue']
|
12
12
|
@price = hash_values['ItemPrice']
|
13
13
|
@restriction = hash_values['ItemRestriction']
|
14
14
|
@restriction_detail = hash_values['ItemRestrictionDetail']
|
15
|
+
@available_inventory = hash_values['ItemAvailableInventory']
|
16
|
+
@item_contract_type = hash_values['ItemContractType']
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/RDC/request.rb
CHANGED
@@ -12,9 +12,9 @@ module RDC
|
|
12
12
|
|
13
13
|
def base_url
|
14
14
|
if RDC.environment == 'production'
|
15
|
-
'
|
15
|
+
'https://connect.restaurant.com/api'
|
16
16
|
else
|
17
|
-
'https://dev-connect.restaurant.com/api'
|
17
|
+
'https://dev-connect.restaurant.com/api'
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
data/lib/RDC/restaurant.rb
CHANGED
@@ -5,7 +5,9 @@ require_relative 'item'
|
|
5
5
|
module RDC
|
6
6
|
class Restaurant
|
7
7
|
attr_accessor :name, :items, :short_description, :long_description,
|
8
|
-
:online, :address, :image, :id
|
8
|
+
:online, :address, :image, :id, :communication_media,
|
9
|
+
:recommended_rank, :rating, :cuisines, :additional_attributes,
|
10
|
+
:secondary_image, :listing_image, :new_restaurant
|
9
11
|
|
10
12
|
def initialize(hash_values)
|
11
13
|
@id = hash_values['LegacyRestaurantId']
|
@@ -13,9 +15,17 @@ module RDC
|
|
13
15
|
@short_description = hash_values['ShortDescription']
|
14
16
|
@long_description = hash_values['LongDescription']
|
15
17
|
@online = hash_values['OnlineReservation']
|
18
|
+
@recommended_rank = hash_values['RecommendedRank']
|
19
|
+
@rating = hash_values['Rating']
|
20
|
+
@cuisines = hash_values['Cuisine']
|
21
|
+
@additional_attributes = hash_values['Attributes']
|
16
22
|
|
17
23
|
@address = hash_values['LocationAddress']
|
24
|
+
@communication_media = hash_values['CommunicationMedia']
|
18
25
|
@image = hash_values.dig('CatalogImagesFullPath', 'MainLogo')
|
26
|
+
@secondary_image = hash_values.dig('CatalogImagesFullPath', 'MicrositeImage1')
|
27
|
+
@listing_image = hash_values.dig('CatalogImagesFullPath', 'ListingsImage')
|
28
|
+
@new_restaurant = hash_values.dig('Dates', 'NewRestaurantAdded') || false
|
19
29
|
@items = Array.wrap(hash_values.dig('Items', 'Item')).collect { |item_hash| RDC::Item.new(item_hash) }
|
20
30
|
end
|
21
31
|
end
|
data/lib/RDC/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RDC
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- davidrichey
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: net-sftp
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|