unit-ruby 0.2.7 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae38f8e1ee09fd207b735b74d15de81fba939d1f1c5cc5314bb5ad25fd3d9340
4
- data.tar.gz: 79b0207921b5dbe4b5532dfcedeb52ed2d83543cffc8ef1c3d75779a889fc6c9
3
+ metadata.gz: 7417620acf3f69df5f634207b4bf0e97d5a7e45aca790ce22b57aa2d8fd84614
4
+ data.tar.gz: 11cbabcdb449614599cf252f7ea514b931a6ba7568efec791a11d053f32df866
5
5
  SHA512:
6
- metadata.gz: 7a8f58c875a14c2893aaa953e171aa1b152eac07b5970a63dd54880033b50a8177babf9ce06c35ee5acc64b62cd9cd8397353a2e2df4d0327172092891e49d9a
7
- data.tar.gz: 36dc9055d927889bdeddf29a637720cb7f2fb9349131e74df0c9267216f64bae2bab56f1ed3de514f655549aa031a2d76e978b7aa739c487e89b048f67bdb52c
6
+ metadata.gz: ce872f36d6ec31367d22ef794ca47d88748bcc051d92b8000715cf5c011193f8f9ea48e4c898dd46bb1a8710bdd50b330eee0a37cd7b12e2eb049023b67c89be
7
+ data.tar.gz: 48665a1223b85b440e4b4d0fdbb4af7008f9209f95d29b0c4cd9e9d15cd9a94b2248475b36d8b565ee616dfa387f29f3315223203a2a0e5659d808ebce40cc28
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unit-ruby (0.2.6)
4
+ unit-ruby (0.4.0)
5
5
  activesupport (>= 6.1.5, < 7.1.0)
6
6
  faraday (~> 1.8.0)
7
7
  faraday_middleware (~> 1.0.0)
@@ -89,7 +89,7 @@ PLATFORMS
89
89
  ruby
90
90
 
91
91
  DEPENDENCIES
92
- bundler (~> 1.17)
92
+ bundler (~> 2.4.0)
93
93
  dotenv (~> 2.7.6)
94
94
  pry
95
95
  rake (~> 13.0)
@@ -98,4 +98,4 @@ DEPENDENCIES
98
98
  unit-ruby!
99
99
 
100
100
  BUNDLED WITH
101
- 1.17.2
101
+ 2.4.19
data/README.md CHANGED
@@ -45,12 +45,11 @@ In order to publish this gem on [RubyGems.org](https://rubygems.org/), you will
45
45
 
46
46
  Once your account is set up, the following operations will facilitate publishing the latest version of the gem:
47
47
 
48
- 1. Ensure that PR request is approved by appropriate member(s) of the engineering team
49
- 2. Update the gem version number in `version.rb`
48
+ 1. After making your changes to the gem, update the version number in `version.rb` and open a PR for review using semantic versioning
49
+ 2. Ensure that PR request is approved by appropriate member(s) of the engineering team before publishing the gem in the below steps
50
50
  3. Run `gem build unit-ruby`. This will build a version of the gem called `unit-ruby-[gem version number].gem`
51
51
  4. Push this latest version of the gem to RubyGems.org by calling `gem push unit-ruby-[gem version number].gem`
52
- 5. Commit `version.rb` file
53
- 6. Merge PR into `main` branch
52
+ 5. Merge PR into `main` branch
54
53
 
55
54
  ## Contributing
56
55
 
@@ -0,0 +1,12 @@
1
+ module Unit
2
+ class Authorization < APIResource
3
+ path '/authorizations'
4
+
5
+ attribute :amount, Types::Integer
6
+ attribute :status, Types::String
7
+ attribute :summary, Types::String
8
+ attribute :created_at, Types::DateTime, readonly: true
9
+
10
+ include ResourceOperations::List
11
+ end
12
+ end
@@ -17,6 +17,7 @@ module Unit
17
17
  attribute :tags, Types::Hash # Optional. Tags that will be copied to the customer that this application creates
18
18
  attribute :idempotency_key, Types::String # Optional
19
19
  attribute :device_fingerprints, Types::Array # array of Device Fingerprint Optional. A list of device fingerprints for fraud and risk prevention
20
+ attribute :occupation, Types::String # Occupation of the individual
20
21
 
21
22
  attribute :created_at, Types::DateTime, readonly: true
22
23
  attribute :status, Types::String, readonly: true
@@ -124,6 +124,16 @@ module Unit
124
124
  [send(singular_resource_name)].compact
125
125
  end
126
126
  end
127
+
128
+ define_method("#{resource_name}=") do |resources|
129
+ singular_resource_name = resource_name.to_s.singularize.to_sym
130
+
131
+ relationships[resource_name] = {
132
+ data: resources.map do |resource|
133
+ { type: singular_resource_name, id: resource.id }
134
+ end
135
+ }
136
+ end
127
137
  end
128
138
 
129
139
  # Hyrdates an instance of the resource from data returned from the API
@@ -1,3 +1,3 @@
1
1
  module Unit
2
- VERSION = '0.2.7'
2
+ VERSION = '0.4.0'
3
3
  end
data/lib/unit-ruby.rb CHANGED
@@ -23,6 +23,7 @@ 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/authorization'
26
27
  require 'unit-ruby/customer_token_verification'
27
28
  require 'unit-ruby/customer_token'
28
29
  require 'unit-ruby/deposit_account'
data/unit-ruby.gemspec CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency 'faraday', '~> 1.8.0'
39
39
  spec.add_dependency 'faraday_middleware', '~> 1.0.0'
40
40
 
41
- spec.add_development_dependency 'bundler', '~> 1.17'
41
+ spec.add_development_dependency 'bundler', '~> 2.4.0'
42
42
  spec.add_development_dependency 'dotenv', '~> 2.7.6'
43
43
  spec.add_development_dependency 'pry'
44
44
  spec.add_development_dependency 'rake', '~> 13.0'
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chloe Isacke
8
8
  - Ian Yamey
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-03-27 00:00:00.000000000 Z
12
+ date: 2023-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -65,14 +65,14 @@ dependencies:
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.17'
68
+ version: 2.4.0
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.17'
75
+ version: 2.4.0
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: dotenv
78
78
  requirement: !ruby/object:Gem::Requirement
@@ -143,7 +143,7 @@ dependencies:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: 1.24.1
146
- description:
146
+ description:
147
147
  email:
148
148
  - chloe@retirable.com
149
149
  - ian@retirable.com
@@ -169,6 +169,7 @@ files:
169
169
  - lib/unit-ruby/ach_payment.rb
170
170
  - lib/unit-ruby/application_form.rb
171
171
  - lib/unit-ruby/atm_location.rb
172
+ - lib/unit-ruby/authorization.rb
172
173
  - lib/unit-ruby/customer_token.rb
173
174
  - lib/unit-ruby/customer_token_verification.rb
174
175
  - lib/unit-ruby/deposit_account.rb
@@ -210,7 +211,7 @@ metadata:
210
211
  source_code_uri: https://github.com/retirable/unit-ruby
211
212
  changelog_uri: https://github.com/retirable/unit-ruby/blob/main/CHANGELOG.md
212
213
  rubygems_mfa_required: 'true'
213
- post_install_message:
214
+ post_install_message:
214
215
  rdoc_options: []
215
216
  require_paths:
216
217
  - lib
@@ -225,8 +226,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
226
  - !ruby/object:Gem::Version
226
227
  version: '0'
227
228
  requirements: []
228
- rubygems_version: 3.3.26
229
- signing_key:
229
+ rubygems_version: 3.2.3
230
+ signing_key:
230
231
  specification_version: 4
231
232
  summary: A Ruby gem for communicating with the Unit API.
232
233
  test_files: []