incognia_api 0.5.2 → 0.5.4

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
  SHA256:
3
- metadata.gz: 6475d6c1fa5bf56e643e001516911dad924d51c48022f2f2ff3888a756443581
4
- data.tar.gz: 7af66755bea5f89918309815d9a10fbfeda56917db601ef5bb9a73f7c92788c1
3
+ metadata.gz: af8fb7e359ca87d916e8f74cde5f55ee52de4aaa4c71a94ec5e820855928f96b
4
+ data.tar.gz: 8dadbdb4f14cab40b10288e935742c165917c754fb0e43a57808a260fe0be16c
5
5
  SHA512:
6
- metadata.gz: ec274dd33ff8ad18bbed3fc9ed6062457affa9b8640234c9b7bac5581867801a01a98b56c8ad8a606185e4e211ce0ce590f664e11bfe70c76d883d3e896c4461
7
- data.tar.gz: 861d1ac7d0cbd767f799bee589a9a947c2d4922b31abf3fcc9152ac606560e300a412a558795ae4f120a168e4506007cefa977cd8bab51830c652ddd910f11ee
6
+ metadata.gz: af029dd1770b82fa7bde6de307612fa1fc22eb6ca48154e866af2d91771929fe10d5c65e9e9f1d4cf859750c64e0ecddd312c76ce3616939db82e8a5e8fbac21
7
+ data.tar.gz: f87e6c0a7a48655a58126d12f7be63deccfe996a80a47252e109f4e8b0626d5919f66ae4bb49e19b5155723dcf15bdb599b0f5acfcc724a549a84b6ca266bab5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.4] - 2024-03-19
4
+
5
+ - Allow registering feedback with expires_at parameter
6
+
3
7
  ## [0.5.1] - 2023-07-13
4
8
 
5
9
  - Allow registering payments
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- incognia_api (0.5.2)
4
+ incognia_api (0.5.4)
5
5
  faraday (~> 1.10)
6
6
  faraday_middleware (~> 1.2)
7
7
 
data/README.md CHANGED
@@ -207,7 +207,10 @@ assessment = api.register_payment(
207
207
 
208
208
  This method registers a feedback event for the given identifiers (optional arguments), returning true when success.
209
209
 
210
- The `timestamp` argument should be a _Time_, _DateTime_ or an _Integer_ being the timestamp in milliseconds:
210
+ The `timestamp` argument should be a _Time_, _DateTime_ or an _Integer_ being the timestamp in milliseconds.
211
+
212
+ The `expires_at` argument should be a _Time_, _DateTime_ or an date in **RFC 3339** format.
213
+
211
214
 
212
215
  ```ruby
213
216
  account_id = "cdb2cfbb-8ad8-4668-b276-5fff9bbfdc96"
@@ -15,7 +15,7 @@ module Incognia
15
15
  host: "https://api.incognia.com/api")
16
16
  end
17
17
 
18
- def register_signup(installation_id:, address: nil, **opts)
18
+ def register_signup(installation_id:, address: nil, **opts)
19
19
  params = { installation_id: installation_id }
20
20
  params.merge!(opts)
21
21
  params.merge!(address&.to_hash) if address
@@ -38,13 +38,13 @@ module Incognia
38
38
  SignupAssessment.from_hash(response.body) if response.success?
39
39
  end
40
40
 
41
- def register_login(installation_id:, account_id:, **opts)
42
- params = {
43
- type: :login,
44
- installation_id: installation_id,
45
- account_id: account_id,
46
- }
47
- params.merge!(opts)
41
+ def register_login(installation_id:, account_id:, **opts)
42
+ params = {
43
+ type: :login,
44
+ installation_id: installation_id,
45
+ account_id: account_id,
46
+ }
47
+ params.merge!(opts)
48
48
 
49
49
  response = connection.request(
50
50
  :post,
@@ -55,10 +55,11 @@ module Incognia
55
55
  LoginAssessment.from_hash(response.body) if response.success?
56
56
  end
57
57
 
58
- def register_feedback(event: , timestamp: nil, **ids)
58
+ def register_feedback(event:, timestamp: nil, expires_at: nil, **ids)
59
59
  timestamp = timestamp.strftime('%s%L') if timestamp.respond_to? :strftime
60
+ expires_at = expires_at.strftime('%FT%TZ') if expires_at.respond_to? :strftime
60
61
 
61
- params = { event: event, timestamp: timestamp&.to_i }.compact
62
+ params = { event: event, timestamp: timestamp&.to_i, expires_at: expires_at }.compact
62
63
  params.merge!(ids)
63
64
 
64
65
  response = connection.request(
@@ -1,13 +1,13 @@
1
1
  require 'delegate'
2
2
 
3
3
  module Incognia
4
- class APIResource < SimpleDelegator
4
+ class APIResource < OpenStruct
5
5
  def self.from_hash(hash)
6
6
  hash = hash.each_with_object({}) do |(k, v), h|
7
7
  h[k] = v.is_a?(Hash) ? from_hash(v) : v
8
8
  end
9
9
 
10
- new(OpenStruct.new(hash))
10
+ new(hash)
11
11
  end
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Incognia
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.4"
5
5
  end
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: 0.5.2
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Cavalcanti
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-11 00:00:00.000000000 Z
11
+ date: 2024-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.3.7
95
+ rubygems_version: 3.1.6
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Official Ruby lib for communicating with Incognia API