seam 2.3.0 → 2.3.1
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 +17 -9
- 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: 4fced77e112ee358ca721e54afcfc60a9ea76a6578d749fbcfc3993c4d4458e8
|
4
|
+
data.tar.gz: f70dec082ae18bfd07e93d84b86588efb77f30603d0db3ad8354774ff737428b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 073ef3f1929e9f1d0b75b66c249cdeec61ecb37998a634bacc22b3fe7d65f7021f106a6bd000b6b42354647906d0ccf8563e65124e54142c0780900a1608b930
|
7
|
+
data.tar.gz: 256cfa6c4b3df7a11646e58a688dfe98827c2a8756bec9aa006ad81412891c300b434906b41048e10b9bad6f984993ff1995fbcf553213857e5c30d53beddd2f
|
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)
|
@@ -60,6 +53,21 @@ module Seam
|
|
60
53
|
def parse_datetime(value)
|
61
54
|
Time.parse(value)
|
62
55
|
end
|
56
|
+
|
57
|
+
def process_data_attributes(data)
|
58
|
+
data.each do |key, value|
|
59
|
+
value = process_hash_value(value)
|
60
|
+
instance_variable_set(:"@#{key}", value)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def process_hash_value(value)
|
65
|
+
if value.is_a?(Hash) && !value.empty?
|
66
|
+
Seam::DeepHashAccessor.new(value)
|
67
|
+
else
|
68
|
+
value
|
69
|
+
end
|
70
|
+
end
|
63
71
|
end
|
64
72
|
end
|
65
73
|
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.1
|
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
|