RDC 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: a07c12269137a5a3dd6bca0cb50d26713609cf1cc7144701cb14a37cfb9b7bd9
4
- data.tar.gz: 57a9febb60d4f25cb0822b38f323666ae471bf3acaad973cd7400e2ddceca99b
3
+ metadata.gz: 296ad5ee8fdf75da3cc8dab3640dcccbe04f16a7fa5c465253666db9ddabd43d
4
+ data.tar.gz: 3218e90fca0a4d9db1523f173fe798216ac4c8de5bad9ee573e1c6fde2d93ce2
5
5
  SHA512:
6
- metadata.gz: d07f8b8b20af061fa3882baf073ae00eab0b7a8fd1c760037ef50a17ae14f2ee16dfff21af7af591b6d9f9c65638b9df427b0b7234f62c70a6e96dc158fe56af
7
- data.tar.gz: 9320d4073c1d2d3e77f9b8e3119734f5cd51033b935e61e1eaf9134e9d5bea5d8930c494b9af3c27db8629977c83110c0bd604dc3f20da802afc15737ae18cf2
6
+ metadata.gz: d6f7af05ca5a4d6f19688470da2d4c86f8ab6923f37ff2aa471c68d5b4362cace877a9c78080141921b868bec990a45eba8b151263cc0782342b6f79775ac6cd
7
+ data.tar.gz: '028971bffed27b3689fd5eb1e64f986a4dc40cb5391d7c6d10067d1e8eb1643863a21e813132e3a82ed028605f0dcb13312dfa061523d8e6593a571e33506250'
@@ -16,35 +16,27 @@ module RDC
16
16
  end
17
17
 
18
18
  def download_xml_catalog
19
- puts '[RDC] Start Downloading ZIP File from FTP Server.'
20
19
  Net::SFTP.start(RDC.ftp_url, RDC.ftp_username, password: RDC.ftp_password) do |sftp|
21
20
  sftp.download!('/rdc_MemberHub.zip', downloads_directory.join('rdc_MemberHub.zip').to_s)
22
21
  end
23
- puts '[RDC] Finished Downloading ZIP File from FTP Server.'
24
22
  end
25
23
 
26
24
  def extract_zip_file
27
- puts '[RDC] Starting Extracting XML File from ZIP File.'
28
25
  Zip::File.open(downloads_directory.join('rdc_MemberHub.zip')) do |zip_file|
29
26
  zip_file.each do |f|
30
27
  fpath = File.join(downloads_directory.to_s, f.name)
31
28
  zip_file.extract(f, fpath) unless File.exist?(fpath)
32
29
  end
33
30
  end
34
- puts '[RDC] Done Extracting XML File from ZIP File.'
35
31
  end
36
32
 
37
33
  def parse_xml_file
38
- puts '[RDC] Parsing XML'
39
34
  xml_file_path = downloads_directory.join('rdc_MemberHub.xml')
40
35
  @xml = Hash.from_xml(File.open(xml_file_path))
41
- puts '[RDC] Finished parsing XML'
42
36
  end
43
37
 
44
38
  def process_xml_content
45
- puts '[RDC] Starting XML Processing'
46
39
  @catalog = @xml["Catalogs"]["catalog"].collect { |catalog_hash| RDC::Restaurant.new(catalog_hash) }
47
- puts '[RDC] Finished XML Processing'
48
40
  @catalog
49
41
  end
50
42
 
@@ -5,10 +5,10 @@ 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
8
+ :online, :address, :image, :id
9
9
 
10
10
  def initialize(hash_values)
11
- puts "Initializing Restaurant #{hash_values['RestaurantName']}"
11
+ @id = hash_values['LegacyRestaurantId']
12
12
  @name = hash_values['RestaurantName']
13
13
  @short_description = hash_values['ShortDescription']
14
14
  @long_description = hash_values['LongDescription']
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'RDC/request'
3
+ require_relative 'request'
4
4
 
5
5
  module RDC
6
6
  class RestaurantInfo
7
7
  class << self
8
8
  def retrieve(restaurant_id)
9
9
  request = Request.new("/restaurant_info/#{restaurant_id}")
10
- reponse = request.get
10
+ response = request.get
11
11
  response.json
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module RDC
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - davidrichey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-12-03 00:00:00.000000000 Z
12
+ date: 2020-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport