rallio 0.1.0 → 0.2.0
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/README.md +14 -0
- data/lib/rallio/user.rb +7 -2
- data/lib/rallio/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67177a5826383f816771b2df2496297098fa24af
|
4
|
+
data.tar.gz: d7a9f1a90aaf9393a8a442b65ee1348eada12b4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4792240007fa51ae3acf1f3054d849b85ca4c3a7d7b3f037ae06ba259af9a543436a72565fd76cd9e8707228734f24147531be4872c8a655f4f4ccbe7f43c0ce
|
7
|
+
data.tar.gz: ff68eb909daee76395108a2a4e2a5e47e2d66fd8de5aa68cdcbd6191e46953fb257ba177010c7122c2afe19bd73bfc6986a24bb99a2166f6b99d7559f47afabc
|
data/README.md
CHANGED
@@ -80,6 +80,20 @@ user.access_token
|
|
80
80
|
# => <Rallio::AccessToken @access_token="4a25dd89e50bd0a0db1eeae65864fe6b", @user_id=100, @expires_at=nil, @scopes="user_info basic_access">
|
81
81
|
```
|
82
82
|
|
83
|
+
#### #me
|
84
|
+
|
85
|
+
This calls out and gets the user info for a given id. All that is needed is to
|
86
|
+
instantiate an instance with a valid user id an calling me will pull the rest
|
87
|
+
of the information.
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
user = Rallio::User.new(id: 100)
|
91
|
+
# => <Rallio::User @id=100, @email=nil, @first_name=nil, @last_name=nil, @accounts=[], @franchisors=[]>
|
92
|
+
|
93
|
+
user.me
|
94
|
+
# => <Rallio::User @id=100, @email="bob@yourcompany.com", @first_name="Bob", @last_name="Anderson", @accounts=[], @franchisors=[]>
|
95
|
+
```
|
96
|
+
|
83
97
|
### SignOnToken
|
84
98
|
|
85
99
|
#### .create
|
data/lib/rallio/user.rb
CHANGED
@@ -14,12 +14,17 @@ module Rallio
|
|
14
14
|
|
15
15
|
def sign_on_tokens
|
16
16
|
SignOnToken.create(user_id: id)
|
17
|
-
# response = self.class.post("/users/#{id}/sign_on_tokens", headers: app_credentials)
|
18
|
-
# SignOnToken.new response.parsed_response[:sign_on_token]
|
19
17
|
end
|
20
18
|
|
21
19
|
def access_token
|
22
20
|
@access_token ||= AccessToken.create(user_id: id)
|
23
21
|
end
|
22
|
+
|
23
|
+
def me
|
24
|
+
headers = { 'Authentication' => "Bearer #{access_token.access_token}" }
|
25
|
+
response = self.class.get('/users/me', headers: headers)
|
26
|
+
self.attributes = response.parsed_response
|
27
|
+
self
|
28
|
+
end
|
24
29
|
end
|
25
30
|
end
|
data/lib/rallio/version.rb
CHANGED