treezor_connect 0.18.0 → 0.18.1

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: 62135597a3a258409cfb519b1559f332e661e4b8641605199b1fdf9a579db9f9
4
- data.tar.gz: 0c200a83d5ef1d4e1a671585ad6768afa74c5bb48f748d464e9014627bcf516d
3
+ metadata.gz: db2ed2a4b70b4bd06ad796542a06ddc68e0e33a60162b9bccd6da971ab0eaff9
4
+ data.tar.gz: 262f23cf3c606aa310e6567ad1b06541e78d5b8d34f652cf78348def6cd23219
5
5
  SHA512:
6
- metadata.gz: a9bb67df7d62da142fa4fa60906644c66874be207f04568d645e4428ed0e4cb0a1250cec9faf102cb34e2bca5b7a654841a843e4f04c9337060466c0e82bbaa7
7
- data.tar.gz: 85538da9313be4b364e5d924dbffe655fb172f3717a13d449074cc640cf5608fcdc1c350908dbe73a475686b94c20bb79702d7e5b248c75bede6b98cf61e90dd
6
+ metadata.gz: c5b6c082ecd159415afc089885ba688602b13e18267bec2e2690d9bc71952e2c01804d0a644d4e5db92619d9202079d6e06d381321aa34e796faea0537558f98
7
+ data.tar.gz: 43f235d73a6fc116a6eb7ea64663aff9fbae187a80cf0d35307e3c52208dba5ec74e47efb9d1b2014c4548507ebf40dc7bb24fb2f0703e98aa866cc9516bb4a9
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TreezorConnect
4
- class ApiResource
4
+ class ApiResource < TreezorObject
5
5
  include TreezorConnect::ApiOperations::Request
6
6
 
7
7
  class << self
@@ -6,6 +6,12 @@ module TreezorConnect
6
6
  @attributes = {}
7
7
  end
8
8
 
9
+ def to_hash
10
+ @attributes.transform_values do |value|
11
+ transform_value(value)
12
+ end
13
+ end
14
+
9
15
  def self.construct_from(data, opts = {})
10
16
  object_class = constantize_object_class(opts[:object_class])
11
17
  id = extract_id(data, object_class)
@@ -44,5 +50,15 @@ module TreezorConnect
44
50
  end
45
51
  end
46
52
  end
53
+
54
+ private
55
+
56
+ def transform_value(value)
57
+ if value.is_a?(Array)
58
+ value.map { |v| v.respond_to?(:to_hash) ? v.to_hash : v }
59
+ else
60
+ value.respond_to?(:to_hash) ? value.to_hash : value
61
+ end
62
+ end
47
63
  end
48
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treezor_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - stefakins
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-03-18 00:00:00.000000000 Z
12
+ date: 2025-03-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A gem for making HTTP calls to Treezor Connect.
15
15
  email: stefan.atkinson69@gmail.com