etwin 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -5
- data/lib/etwin/client/http_etwin_client.rb +8 -1
- data/lib/etwin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69cc4a2279c94d413db0a4481a1370c9fc3f4e941c51742bff6398d19c76df74
|
4
|
+
data.tar.gz: c9c3e99a3f1242cb68adeb9b3edb8264855777698dc31df601e6845d5bc45e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3d1d50d6109fa53d73b009cdf2e7bb866ad9eb7e70a92a4ee00663799111023c74cdaba9cfb4683bff2ba607f8bc54ab9c9b96609f6ee48ee5b8649a304c842
|
7
|
+
data.tar.gz: a24475b7fece1104fa8deca475d8de443a897c2c24c8908914094ed69dc5614c85f245575d86cccf5423c77f20c8a46cde7bcd9a0f434662cbd10ba994a05fba
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,13 +2,12 @@
|
|
2
2
|
|
3
3
|
## Installation
|
4
4
|
|
5
|
-
Add
|
5
|
+
Add a dependency on the `etwin` gem.
|
6
6
|
|
7
|
-
|
8
|
-
gem 'etwin'
|
9
|
-
```
|
7
|
+
- Either add `spec.add_runtime_dependency('etwin', '~> 0.0.3')` to your `*.gemspec`
|
8
|
+
- Or add `gem 'etwin', '~> 0.0.3'` to your `Gemfile`
|
10
9
|
|
11
|
-
And then
|
10
|
+
And then run:
|
12
11
|
|
13
12
|
```
|
14
13
|
bundle install
|
@@ -14,14 +14,21 @@ module Etwin
|
|
14
14
|
|
15
15
|
sig(:final) { params(base_uri: URI::HTTP).void }
|
16
16
|
def initialize(base_uri)
|
17
|
+
# @type [URI::HTTP]
|
17
18
|
@base_uri = T.let(base_uri.freeze, URI::HTTP)
|
19
|
+
# @type [Faraday::Connection]
|
20
|
+
@client = T.let(Faraday::Connection.new.freeze, Faraday::Connection)
|
18
21
|
freeze
|
19
22
|
end
|
20
23
|
|
21
24
|
sig(:final) { override.params(auth: Auth, user_id: Etwin::User::UserId).returns(Etwin::User::User) }
|
22
25
|
def get_user(auth, user_id)
|
23
26
|
uri = resolve(['users', user_id.to_s])
|
24
|
-
|
27
|
+
# @type [Faraday::Request] req
|
28
|
+
# @type [Faraday::Response] res
|
29
|
+
res = @client.get uri do |req|
|
30
|
+
req.headers['Authorization'] = auth.authorization_header
|
31
|
+
end
|
25
32
|
Etwin::User::User.from_json res.body
|
26
33
|
end
|
27
34
|
|
data/lib/etwin/version.rb
CHANGED