lutaml 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98c639beedce6095e724dd236e5dc3037d74b58cf1624ff7c6c8d262a32c6e98
4
- data.tar.gz: 3e51d0cef9b57a0e7f22922e6de07cdecef034ab03dd8fa9869f8aa35fc36c7e
3
+ metadata.gz: baef07d33c5aa163875a731b0dcbcf9de336d0bcb6c1066a17d74210e8d26d3a
4
+ data.tar.gz: b3b000fe77946b863f5ee539319ef777ea14b20de6c607091dcf84c059ccd732
5
5
  SHA512:
6
- metadata.gz: 023b5fe40356139612aa5426c76cd72971a7763f182bb1d6c4e13e8d718e2a875352b1fbfcd0d03b126fc3313e359c8ade3fb03d681e03db735ec344f7876050
7
- data.tar.gz: ff7e1f727d0709a88e3d88b41cd89d544c7f0a38ed145b0791c7aa15b0bca7446da485ec85adb2180a5c1108cd056265c6e5b47826ebbf77061ab01a3eaa326f
6
+ metadata.gz: 6319856a0ef1833a797e5d6aba050a83d2d145e16d508f5a9c84cfe9484b958949a5c6ca906a373bbf2786c486b7e684237c49ee907ce21caa5e58c83f0d39a9
7
+ data.tar.gz: b96dedf55a1689f9213ab9d3add19ceae2c3110953721a99ddf74913b572bfff28406635a6d6b01b33431a8fbc3131971b2d6058aacabce132b7b3b8d1068913
@@ -8,6 +8,10 @@ module Lutaml
8
8
  end
9
9
 
10
10
  def to_liquid
11
+ serialized_document
12
+ end
13
+
14
+ def serialized_document
11
15
  @serialized_document ||= serialize_document(@original_document)
12
16
  end
13
17
 
@@ -25,9 +29,9 @@ module Lutaml
25
29
  serialize_to_hash(attr_value)
26
30
  end
27
31
 
32
+ BASE_OBJECTS = [String, Integer, Float, FalseClass, TrueClass, Symbol, NilClass, Hash]
28
33
  def serialize_to_hash(object)
29
- return object if [String, Integer, Float, FalseClass, TrueClass,
30
- Symbol, NilClass, Hash].include?(object.class)
34
+ return object if BASE_OBJECTS.include?(object.class)
31
35
 
32
36
  object.instance_variables.each_with_object({}) do |var, res|
33
37
  variable = object.instance_variable_get(var)
@@ -35,7 +39,7 @@ module Lutaml
35
39
  variable.map do |n|
36
40
  serialize_to_hash(n)
37
41
  end
38
- elsif [String, Integer, Float, FalseClass, TrueClass, Symbol, NilClass, Hash].include?(variable.class) || var == :@parent
42
+ elsif BASE_OBJECTS.include?(variable.class) || var == :@parent
39
43
  variable
40
44
  else
41
45
  serialize_to_hash(variable)
@@ -1,3 +1,3 @@
1
1
  module Lutaml
2
- VERSION = "0.7.6".freeze
2
+ VERSION = "0.7.7".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-07 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: expressir