unit-ruby 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6cb6013957f5fb86b11a7112b26b4d012c5cba20a35d214667be9f4cc352057
4
- data.tar.gz: 299368d998697e2522f914cc68adf61bae766231dc2c5ce3b3b273d8765e87ad
3
+ metadata.gz: 3bb24533446bfd10538c49ee2a9c28c6428bcc93c316d64e5278308809ab963f
4
+ data.tar.gz: f995e561b1d6c63249dac9d9270ecae0ba01bf00c955a7ba9e07a89e7c082b5d
5
5
  SHA512:
6
- metadata.gz: 965abcbb2f9fd0f214b50560f06d73b70e9e1e50be2a74d9d90de62a391136cd7501c6fcb04290181048b3683e55e0062a60dc43f16d857d8b8ece2f0de3f748
7
- data.tar.gz: 377c38ccff1bcbc1f5065057960ed518832037e89aba038f5d9fd73f54451594290750fdc800e11458666a1d1aa41526b777e0b4a86be9ed0dfd7f34bcd6bb8d
6
+ metadata.gz: 8ac97dd5692904c8c2fd902343ea29f7c0da8d9e12fb8d042d5671795f4d221d9f3600415412cd4f6562c294f6549615a5d158781a9addceeae2ad3e971f8dea
7
+ data.tar.gz: 7263a5879b85e666707d506f10f0b0e4ad7b0023fd3e2760163d687268b865f6713bc437e1bedba9153517687fe5a07294a370e9d6e310befc31692b815c4ef4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit-ruby (0.2.3)
4
+ unit-ruby (0.2.4)
5
5
  activesupport
6
6
  faraday (~> 1.8.0)
7
7
  faraday_middleware (~> 1.0.0)
@@ -0,0 +1,18 @@
1
+ module Unit
2
+ class CustomerToken < APIResource
3
+ path '/customers'
4
+
5
+ attribute :scope, Types::String
6
+ attribute :verification_token, Types::String
7
+ attribute :verification_code, Types::String
8
+ attribute :expires_in, Types::Integer
9
+
10
+ attribute :token, Types::String, readonly: true
11
+
12
+ def self.resources_path(id)
13
+ "#{super(id)}/token"
14
+ end
15
+
16
+ include ResourceOperations::Create
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ module Unit
2
+ class CustomerTokenVerification < APIResource
3
+ path '/customers'
4
+
5
+ attribute :channel, Types::String
6
+ attribute :verification_token, Types::String, readonly: true
7
+
8
+ def self.resources_path(id)
9
+ "#{super(id)}/token/verification"
10
+ end
11
+
12
+ include ResourceOperations::Create
13
+ end
14
+ end
@@ -70,7 +70,9 @@ module Unit
70
70
  "#{path}/#{id}"
71
71
  end
72
72
 
73
- def self.resources_path
73
+ def self.resources_path(id = nil)
74
+ return "#{path}/#{id}" if id
75
+
74
76
  path
75
77
  end
76
78
 
@@ -21,7 +21,8 @@ module Unit
21
21
 
22
22
  module ClassMethods
23
23
  def create(attributes)
24
- resource = new(attributes)
24
+ id = attributes.fetch(:id, nil)
25
+ resource = new(attributes.without(:id))
25
26
 
26
27
  data = {
27
28
  type: resource.resource_type,
@@ -32,7 +33,7 @@ module Unit
32
33
  resource.relationships
33
34
  end
34
35
 
35
- created_resource = connection.post(resources_path, { data: data })
36
+ created_resource = connection.post(resources_path(id), { data: data })
36
37
 
37
38
  build_resource_from_json_api(created_resource)
38
39
  end
@@ -1,3 +1,3 @@
1
1
  module Unit
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
data/lib/unit-ruby.rb CHANGED
@@ -23,6 +23,8 @@ require 'unit-ruby/types/string'
23
23
  require 'unit-ruby/ach_payment'
24
24
  require 'unit-ruby/application_form'
25
25
  require 'unit-ruby/atm_location'
26
+ require 'unit-ruby/customer_token_verification'
27
+ require 'unit-ruby/customer_token'
26
28
  require 'unit-ruby/deposit_account'
27
29
  require 'unit-ruby/individual_application'
28
30
  require 'unit-ruby/individual_customer'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chloe Isacke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-04-06 00:00:00.000000000 Z
12
+ date: 2022-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -163,6 +163,8 @@ files:
163
163
  - lib/unit-ruby/ach_payment.rb
164
164
  - lib/unit-ruby/application_form.rb
165
165
  - lib/unit-ruby/atm_location.rb
166
+ - lib/unit-ruby/customer_token.rb
167
+ - lib/unit-ruby/customer_token_verification.rb
166
168
  - lib/unit-ruby/deposit_account.rb
167
169
  - lib/unit-ruby/individual_application.rb
168
170
  - lib/unit-ruby/individual_customer.rb