traceparts 0.1.1 → 0.1.2
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/.gitignore +1 -1
- data/README.md +2 -2
- data/lib/traceparts/client.rb +5 -2
- data/lib/traceparts/user.rb +3 -5
- data/lib/traceparts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7e0b4c1c92aec6e11c84986400a2f6b4ad1be992
|
|
4
|
+
data.tar.gz: dcd72081822b0ab4569954baccf6db81301479a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5934d882c6166bb530f47079f3630dac30d253477761280fb3d3ce7d1859011ec02011494919b10e6b501596d8f403131dfecb90c8c3c79a82619a7a003db88
|
|
7
|
+
data.tar.gz: 408754cf3821e322b45028266d344166fae53271b49bd78bb16c7b70b3114fe04934a955f8eb4a53fea9ca2a9d59cadeef9697690d25d25008ac49411fc5bd27
|
data/.gitignore
CHANGED
data/README.md
CHANGED
|
@@ -73,13 +73,13 @@ user = client.user(user_email)
|
|
|
73
73
|
|
|
74
74
|
# Option 1 (suggested)
|
|
75
75
|
user.exists? # true or false
|
|
76
|
-
user.register(company, country) # true or false
|
|
76
|
+
user.register(company, country, first_name, last_name, phone) # true or false
|
|
77
77
|
|
|
78
78
|
user.email
|
|
79
79
|
|
|
80
80
|
# Option 2
|
|
81
81
|
client.user_exists?(user_email) # true or false
|
|
82
|
-
client.register_user(user_email, company, country) # true or false
|
|
82
|
+
client.register_user(user_email, company, country, first_name, last_name, phone) # true or false
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
### PartNumber data related functionality
|
data/lib/traceparts/client.rb
CHANGED
|
@@ -93,11 +93,14 @@ module Traceparts
|
|
|
93
93
|
json['registered'] == true
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
def register_user(user_email, company, country)
|
|
96
|
+
def register_user(user_email, company, country, first_name, last_name, phone)
|
|
97
97
|
response = get_request('UserRegistration', {
|
|
98
98
|
'UserEmail' => user_email,
|
|
99
99
|
'company' => company,
|
|
100
|
-
'country' => country
|
|
100
|
+
'country' => country,
|
|
101
|
+
'fname' => first_name,
|
|
102
|
+
'name' => last_name,
|
|
103
|
+
'phone' => phone
|
|
101
104
|
})
|
|
102
105
|
|
|
103
106
|
json = JSON.parse(response.body)
|
data/lib/traceparts/user.rb
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
module Traceparts
|
|
2
2
|
class User
|
|
3
|
-
attr_reader :email
|
|
3
|
+
attr_reader :email
|
|
4
4
|
|
|
5
5
|
def initialize(client, email)
|
|
6
6
|
@client = client
|
|
7
7
|
|
|
8
8
|
@email = email
|
|
9
|
-
@company = nil
|
|
10
|
-
@coutry = nil
|
|
11
9
|
end
|
|
12
10
|
|
|
13
11
|
def exists?
|
|
14
12
|
@client.user_exists?(email)
|
|
15
13
|
end
|
|
16
14
|
|
|
17
|
-
def register(company, country)
|
|
18
|
-
@client.register_user(email, company, country)
|
|
15
|
+
def register(company, country, first_name = nil, last_name = nil, phone = nil)
|
|
16
|
+
@client.register_user(email, company, country, first_name, last_name, phone)
|
|
19
17
|
end
|
|
20
18
|
end
|
|
21
19
|
end
|
data/lib/traceparts/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: traceparts
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Zilvinas
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|