gotransverse-tract-api 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b789ee39703041636a1bdb4b4a9c5c3092fcc8
|
4
|
+
data.tar.gz: dc53204c8082464cac0d8ca64331d5af0563a3a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15431161f8fdca74f828ea26ae2cbb0bf4467d2e591f0acf82525ab97332fa34acb7ab45f0e1bd86fbf80293c4e964b2aa518b996d2ac61d0948f8d02301af3c
|
7
|
+
data.tar.gz: 2b3b23974c81b160bc4437dc072e69016d64081836524f201c56b254e0ea182eb97ce15b6f11374f3c4298d9c206af3766dfc998e1ef3d127f99590d80b999c1
|
@@ -42,9 +42,10 @@ require "gotransverse-tract-api/product/operation_attribute"
|
|
42
42
|
require "gotransverse-tract-api/product/price_list"
|
43
43
|
require "gotransverse-tract-api/product/product_price_range"
|
44
44
|
require "gotransverse-tract-api/product/product"
|
45
|
-
require "gotransverse-tract-api/product/product_category"
|
45
|
+
# require "gotransverse-tract-api/product/product_category"
|
46
46
|
require "gotransverse-tract-api/product/product_price"
|
47
47
|
require "gotransverse-tract-api/product/usage_rule"
|
48
|
+
# require "gotransverse-tract-api/product/discount_category"
|
48
49
|
|
49
50
|
require "gotransverse-tract-api/service/service"
|
50
51
|
require "gotransverse-tract-api/service/service_device_inventory_item"
|
@@ -87,7 +88,7 @@ module GoTransverseTractApi
|
|
87
88
|
# end
|
88
89
|
#
|
89
90
|
def self.configure
|
90
|
-
self.configuration ||= Configuration.new
|
91
|
+
self.configuration ||= GoTransverseTractApi::Configuration.new
|
91
92
|
yield(configuration)
|
92
93
|
end
|
93
94
|
|
@@ -111,6 +112,8 @@ module GoTransverseTractApi
|
|
111
112
|
|
112
113
|
api_url = GoTransverseTractApi.get_api_url_for(klass)
|
113
114
|
|
115
|
+
pp "api_url: " + api_url
|
116
|
+
|
114
117
|
if GoTransverseTractApi.configuration.cache_enabled
|
115
118
|
return self.get_cached_response_from(klass, api_params)
|
116
119
|
end
|
@@ -1,40 +1,42 @@
|
|
1
|
-
|
1
|
+
module GoTransverseTractApi
|
2
2
|
|
3
|
-
|
4
|
-
attr_accessor :password
|
5
|
-
attr_accessor :basic_credentials
|
3
|
+
class Configuration
|
6
4
|
|
7
|
-
|
5
|
+
attr_accessor :user_id
|
6
|
+
attr_accessor :password
|
7
|
+
attr_accessor :basic_credentials
|
8
8
|
|
9
|
-
|
10
|
-
attr_accessor :tract_api_url
|
9
|
+
attr_accessor :cache_enabled
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
def initialize
|
16
|
-
@tract_api_host ||= "https://my.tractbilling.com"
|
17
|
-
@tract_api_url = "#{@tract_api_host}/t/s/r/#{GoTransverseTractApi::TARGET_API_VERSION}"
|
18
|
-
set_basic_credentials
|
19
|
-
end
|
11
|
+
attr_accessor :tract_api_host
|
12
|
+
attr_accessor :tract_api_url
|
20
13
|
|
21
|
-
|
14
|
+
#
|
15
|
+
# initialize
|
16
|
+
#
|
17
|
+
def initialize
|
18
|
+
@tract_api_host ||= "https://my.tractbilling.com"
|
19
|
+
@tract_api_url = "#{@tract_api_host}/t/s/r/#{GoTransverseTractApi::TARGET_API_VERSION}"
|
20
|
+
set_basic_credentials
|
21
|
+
end
|
22
22
|
|
23
|
-
|
24
|
-
# set_basic_credentials
|
25
|
-
#
|
26
|
-
def set_basic_credentials
|
23
|
+
private
|
27
24
|
|
28
|
-
#
|
29
|
-
|
25
|
+
#
|
26
|
+
# set_basic_credentials
|
27
|
+
#
|
28
|
+
def set_basic_credentials
|
30
29
|
|
31
|
-
|
32
|
-
|
30
|
+
# Perform Base-64 encoding of API login information
|
31
|
+
user_pass = "#{@user_id.to_s}:#{@password.to_s}"
|
33
32
|
|
34
|
-
|
35
|
-
|
33
|
+
# Sets basic_credentials attr_accessor
|
34
|
+
@basic_credentials = Base64.encode64(user_pass)
|
36
35
|
|
37
|
-
|
36
|
+
# Erase in-clear credentials
|
37
|
+
@user_id = @password = nil
|
38
38
|
|
39
|
-
end
|
39
|
+
end
|
40
40
|
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gotransverse-tract-api
|
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
|
- Julien DeFrance
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-11-
|
12
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|