seam 2.3.0 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seam/base_resource.rb +18 -12
- data/lib/seam/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8021a5c173122f3b94f93794cc375a3119af2237acc6d49fd4290a795eda9861
|
4
|
+
data.tar.gz: 9abfaf6963d9fec7f764f9a7c644107d3b1bb8321bb47a861034f227037623f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 026f63d334ec08141c03e767dbf83acb7c13683371bcbfd7d11d85a7949e49e751b5513df761fc3dda93f42a2624ffa71f2d8fa531acc5322cd839b8c39fcd0d
|
7
|
+
data.tar.gz: c6b4b366bf2dd2c016b1d221364edff29b63f476de8030cad9af3902a743607549f6a481f281d5dcc41fde706cedd69c790cbe0292e2219e5d9489b05e21b2c6
|
data/Gemfile.lock
CHANGED
data/lib/seam/base_resource.rb
CHANGED
@@ -11,19 +11,12 @@ module Seam
|
|
11
11
|
def initialize(data, client = nil)
|
12
12
|
@data = data
|
13
13
|
@client = client
|
14
|
-
|
15
|
-
@data.each do |key, value|
|
16
|
-
value = Seam::DeepHashAccessor.new(value) if value.is_a?(Hash)
|
17
|
-
instance_variable_set(:"@#{key}", value)
|
18
|
-
end
|
14
|
+
process_data_attributes(@data)
|
19
15
|
end
|
20
16
|
|
21
17
|
def update_from_response(data)
|
22
18
|
@data = data
|
23
|
-
@data
|
24
|
-
value = Seam::DeepHashAccessor.new(value) if value.is_a?(Hash)
|
25
|
-
instance_variable_set(:"@#{key}", value)
|
26
|
-
end
|
19
|
+
process_data_attributes(@data)
|
27
20
|
end
|
28
21
|
|
29
22
|
def self.load_from_response(data, client = nil)
|
@@ -48,9 +41,7 @@ module Seam
|
|
48
41
|
define_method(attr) do
|
49
42
|
value = instance_variable_get(:"@#{attr}")
|
50
43
|
|
51
|
-
|
52
|
-
|
53
|
-
parse_datetime(value)
|
44
|
+
value.nil? ? nil : parse_datetime(value)
|
54
45
|
end
|
55
46
|
end
|
56
47
|
end
|
@@ -60,6 +51,21 @@ module Seam
|
|
60
51
|
def parse_datetime(value)
|
61
52
|
Time.parse(value)
|
62
53
|
end
|
54
|
+
|
55
|
+
def process_data_attributes(data)
|
56
|
+
data.each do |key, value|
|
57
|
+
value = process_hash_value(value)
|
58
|
+
instance_variable_set(:"@#{key}", value)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def process_hash_value(value)
|
63
|
+
if value.is_a?(Hash) && !value.empty?
|
64
|
+
Seam::DeepHashAccessor.new(value)
|
65
|
+
else
|
66
|
+
value
|
67
|
+
end
|
68
|
+
end
|
63
69
|
end
|
64
70
|
end
|
65
71
|
end
|
data/lib/seam/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seam Labs, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|