incognia_api 2.0.0 → 2.1.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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/incognia_api/api.rb +5 -3
- data/lib/incognia_api/location.rb +23 -0
- data/lib/incognia_api/version.rb +1 -1
- data/lib/incognia_api.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a52bbb4d602bec60845df1106450e7d4642f55cc993635fe67abf05bb1e4faf3
|
4
|
+
data.tar.gz: 88daa93221f7d5901ae3235e7da5175a0a2542e7778543f713687b34d4c49d28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee85936265c871bb6d76a1b10f4c2959d7e2ce9bc3c5df5eba102e5f4a3a1b2b33f35b79636db0b12e79955177dd8733d70e4e5cb8c32a47560f112ac6f3839f
|
7
|
+
data.tar.gz: a9c0b9a25f6b06931d6bc14e0fabb6d4e068d774e9c526e28bf6a66ac5d125b8c2549bee872f6f8e50d6a4781a3ca79a7338ce11e50784963d891c623fec62f0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/incognia_api/api.rb
CHANGED
@@ -12,7 +12,7 @@ module Incognia
|
|
12
12
|
def register_signup(request_token: nil, address: nil, **opts)
|
13
13
|
params = { request_token: request_token }.compact
|
14
14
|
params.merge!(opts)
|
15
|
-
params.merge!(address
|
15
|
+
params.merge!(address.to_hash) if address
|
16
16
|
|
17
17
|
response = connection.request(
|
18
18
|
:post,
|
@@ -23,12 +23,13 @@ module Incognia
|
|
23
23
|
SignupAssessment.from_hash(response.body) if response.success?
|
24
24
|
end
|
25
25
|
|
26
|
-
def register_login(account_id:, request_token: nil, **opts)
|
26
|
+
def register_login(account_id:, request_token: nil, location: nil, **opts)
|
27
27
|
params = {
|
28
28
|
type: :login,
|
29
29
|
account_id: account_id,
|
30
30
|
request_token: request_token
|
31
31
|
}.compact
|
32
|
+
params.merge!(location: location.to_hash) if location
|
32
33
|
params.merge!(opts)
|
33
34
|
|
34
35
|
response = connection.request(
|
@@ -56,12 +57,13 @@ module Incognia
|
|
56
57
|
response.success?
|
57
58
|
end
|
58
59
|
|
59
|
-
def register_payment(account_id:, request_token: nil, **opts)
|
60
|
+
def register_payment(account_id:, request_token: nil, location: nil, **opts)
|
60
61
|
params = {
|
61
62
|
type: :payment,
|
62
63
|
account_id: account_id,
|
63
64
|
request_token: request_token
|
64
65
|
}.compact
|
66
|
+
params.merge!(location: location.to_hash) if location
|
65
67
|
params.merge!(opts)
|
66
68
|
|
67
69
|
response = connection.request(
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
3
|
+
module Incognia
|
4
|
+
class Location
|
5
|
+
attr_reader :latitude, :longitude, :collected_at
|
6
|
+
|
7
|
+
def initialize(latitude:, longitude:, collected_at: nil)
|
8
|
+
@latitude = latitude
|
9
|
+
@longitude = longitude
|
10
|
+
@collected_at = collected_at
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_hash
|
14
|
+
location = {
|
15
|
+
latitude: latitude,
|
16
|
+
longitude: longitude,
|
17
|
+
collected_at: collected_at.respond_to?(:to_datetime) ? collected_at.to_datetime.rfc3339 : collected_at,
|
18
|
+
}.compact
|
19
|
+
|
20
|
+
location
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/incognia_api/version.rb
CHANGED
data/lib/incognia_api.rb
CHANGED
@@ -6,6 +6,7 @@ require_relative "incognia_api/client"
|
|
6
6
|
require_relative "incognia_api/util"
|
7
7
|
require_relative "incognia_api/address"
|
8
8
|
require_relative "incognia_api/api"
|
9
|
+
require_relative "incognia_api/location"
|
9
10
|
|
10
11
|
require_relative "incognia_api/resources/api_resource"
|
11
12
|
require_relative "incognia_api/resources/signup_assessment"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incognia_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- lib/incognia_api/client.rb
|
66
66
|
- lib/incognia_api/configuration.rb
|
67
67
|
- lib/incognia_api/constants/feedback_event.rb
|
68
|
+
- lib/incognia_api/location.rb
|
68
69
|
- lib/incognia_api/resources/api_resource.rb
|
69
70
|
- lib/incognia_api/resources/credentials.rb
|
70
71
|
- lib/incognia_api/resources/login_assessment.rb
|