tuneuptechnology 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e0dccd4117b67f200579ff7db598088ba6647feeee455671d3264f7e36ff0131
4
+ data.tar.gz: 2db139f32bcdfd879c5da9da709dd19ebf02b6e9886d492f20a73f1251c1cbba
5
+ SHA512:
6
+ metadata.gz: 1574e146cb63a2a89a32c74af1fc34f74b747c6350afa21344552f12162b032ebaefce9edc141a7dee48d3d394f83f7c949fc3aca4ac66ad4b9ffbaf14db749d
7
+ data.tar.gz: 6d662e4d337a420bba6aace8f0ded9f061d15644a4a1b6dc46698f4a35c7fcf7284dbf380a565aec235c55a3485ffef5e9e50177ef69ed7aa6cd5f15c7a61e5f
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rest-client'
4
+ require 'json'
5
+
6
+ # Tuneup Technology Resources
7
+ require 'tuneuptechnology/customer'
8
+ require 'tuneuptechnology/inventory'
9
+ require 'tuneuptechnology/location'
10
+ require 'tuneuptechnology/ticket'
11
+
12
+ module TuneupTechnology
13
+ # Build the HTTP client for the library
14
+ class Client
15
+ @base_url = 'https://app.tuneuptechnology.com/api/'
16
+ class << self
17
+ attr_reader :base_url
18
+ end
19
+
20
+ @version = '1.0.0'
21
+ class << self
22
+ attr_reader :version
23
+ end
24
+
25
+ @headers = {
26
+ 'Content-Type' => 'application/json',
27
+ 'User-Agent' => "TuneupTechnologyApp/RubyClient/#{Client.version}"
28
+ }
29
+ class << self
30
+ attr_reader :headers
31
+ end
32
+
33
+ def self.post(data, endpoint)
34
+ response = RestClient.post(endpoint, data.to_json, headers)
35
+ JSON.pretty_generate(JSON.parse(response))
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TuneupTechnology
4
+ # Methods for the Customer object
5
+ class Customer
6
+ # Create a customer
7
+ def self.create(data)
8
+ endpoint = Client.base_url + 'customers/create'
9
+ Client.post(data, endpoint)
10
+ end
11
+
12
+ # Retrieve all customer records
13
+ def self.all(data)
14
+ endpoint = Client.base_url + 'customers'
15
+ Client.post(data, endpoint)
16
+ end
17
+
18
+ # Retrieve a single customer record
19
+ def self.retrieve(data)
20
+ endpoint = Client.base_url + 'customers/' + data['id'].to_s
21
+ Client.post(data, endpoint)
22
+ end
23
+
24
+ # Update a customer record
25
+ def self.update(data)
26
+ endpoint = Client.base_url + 'customers/' + data['id'].to_s + '/update'
27
+ Client.post(data, endpoint)
28
+ end
29
+
30
+ # Delete a customer record
31
+ def self.delete(data)
32
+ endpoint = Client.base_url + 'customers/' + data['id'].to_s + '/delete'
33
+ Client.post(data, endpoint)
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TuneupTechnology
4
+ # Methods for the Inventory object
5
+ class Inventory
6
+ # Create an inventory item
7
+ def self.create(data)
8
+ endpoint = Client.base_url + 'inventory/create'
9
+ Client.post(data, endpoint)
10
+ end
11
+
12
+ # Retrieve all inventory records
13
+ def self.all(data)
14
+ endpoint = Client.base_url + 'inventory'
15
+ Client.post(data, endpoint)
16
+ end
17
+
18
+ # Retrieve a single inventory record
19
+ def self.retrieve(data)
20
+ endpoint = Client.base_url + 'inventory/' + data['id'].to_s
21
+ Client.post(data, endpoint)
22
+ end
23
+
24
+ # Update an inventory record
25
+ def self.update(data)
26
+ endpoint = Client.base_url + 'inventory/' + data['id'].to_s + '/update'
27
+ Client.post(data, endpoint)
28
+ end
29
+
30
+ # Delete an inventory record
31
+ def self.delete(data)
32
+ endpoint = Client.base_url + 'inventory/' + data['id'].to_s + '/delete'
33
+ Client.post(data, endpoint)
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TuneupTechnology
4
+ # Methods for the Location object
5
+ class Location
6
+ # Create a location
7
+ def self.create(data)
8
+ endpoint = Client.base_url + 'locations/create'
9
+ Client.post(data, endpoint)
10
+ end
11
+
12
+ # Retrieve all location records
13
+ def self.all(data)
14
+ endpoint = Client.base_url + 'locations'
15
+ Client.post(data, endpoint)
16
+ end
17
+
18
+ # Retrieve a single location record
19
+ def self.retrieve(data)
20
+ endpoint = Client.base_url + 'locations/' + data['id'].to_s
21
+ Client.post(data, endpoint)
22
+ end
23
+
24
+ # Update a location record
25
+ def self.update(data)
26
+ endpoint = Client.base_url + 'locations/' + data['id'].to_s + '/update'
27
+ Client.post(data, endpoint)
28
+ end
29
+
30
+ # Delete a location record
31
+ def self.delete(data)
32
+ endpoint = Client.base_url + 'locations/' + data['id'].to_s + '/delete'
33
+ Client.post(data, endpoint)
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TuneupTechnology
4
+ # Methods for the Ticket object
5
+ class Ticket
6
+ # Create a ticket
7
+ def self.create(data)
8
+ endpoint = Client.base_url + 'tickets/create'
9
+ Client.post(data, endpoint)
10
+ end
11
+
12
+ # Retrieve all ticket records
13
+ def self.all(data)
14
+ endpoint = Client.base_url + 'tickets'
15
+ Client.post(data, endpoint)
16
+ end
17
+
18
+ # Retrieve a single ticket record
19
+ def self.retrieve(data)
20
+ endpoint = Client.base_url + 'tickets/' + data['id'].to_s
21
+ Client.post(data, endpoint)
22
+ end
23
+
24
+ # Update a ticket record
25
+ def self.update(data)
26
+ endpoint = Client.base_url + 'tickets/' + data['id'].to_s + '/update'
27
+ Client.post(data, endpoint)
28
+ end
29
+
30
+ # Delete a ticket record
31
+ def self.delete(data)
32
+ endpoint = Client.base_url + 'tickets/' + data['id'].to_s + '/delete'
33
+ Client.post(data, endpoint)
34
+ end
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tuneuptechnology
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - NCR4
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-05-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.82.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.82.0
41
+ description: |-
42
+ This library allows you to interact with the customers,
43
+ tickets, inventory, and locations objects without needing to do the hard
44
+ work of binding your calls and data to endpointspec. Simply call an action
45
+ such as `Customer.create` and pass some data and let the library do
46
+ the rest.
47
+ email: justin@ncr4.com
48
+ executables: []
49
+ extensions: []
50
+ extra_rdoc_files: []
51
+ files:
52
+ - lib/tuneuptechnology.rb
53
+ - lib/tuneuptechnology/customer.rb
54
+ - lib/tuneuptechnology/inventory.rb
55
+ - lib/tuneuptechnology/location.rb
56
+ - lib/tuneuptechnology/ticket.rb
57
+ homepage: https://github.com/ncr4/tuneuptechnology-ruby
58
+ licenses:
59
+ - MIT
60
+ metadata: {}
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.1.2
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: The Ruby client library for the Tuneup Technology App.
80
+ test_files: []