lutaml 0.4.1.pre.alpha → 0.4.1.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lutaml/express/lutaml_path/document_wrapper.rb +1 -31
- data/lib/lutaml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f585ad7b175177afe9ac1e3c9a243a7d7f5b4f471eab0268db07c5416071ed7
|
4
|
+
data.tar.gz: 04ea818d961eb1b594f41417a73785d4be620acc81301a1da8f98faa9dae4b2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34dd93e727898bd84c2257dd8d0e10d7f731775d11efc9f9109a2113a382779c00fb1b0be9bcffd174e2610503e12993c0d2306bb629d2f700f970206deddb90
|
7
|
+
data.tar.gz: f754762c5197831a3cceba0a46cbe2868ae13e40b69f05e1e5d6c08c4ea4c8b69cb045c960833a5d1bbdcfb7fb0316d382795099330325725e16feae736fab33
|
@@ -12,40 +12,10 @@ module Lutaml
|
|
12
12
|
def serialize_document(repository)
|
13
13
|
repository.schemas.each_with_object({}) do |schema, res|
|
14
14
|
res["schemas"] ||= []
|
15
|
-
res[schema.id] =
|
15
|
+
res[schema.id] = schema.to_hash(formatter: Expressir::ExpressExp::Formatter)
|
16
16
|
res["schemas"].push(res[schema.id])
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
20
|
-
def serialize_value(object)
|
21
|
-
object.instance_variables.each_with_object({}) do |var, res|
|
22
|
-
variable = object.instance_variable_get(var)
|
23
|
-
if variable.respond_to?(:to_hash)
|
24
|
-
res[var.to_s.gsub("@", "")] = variable.to_hash.merge(SOURCE_CODE_ATTRIBUTE_NAME => entity_source_code(variable))
|
25
|
-
elsif variable.is_a?(Array)
|
26
|
-
res[var.to_s.gsub("@", "")] = variable.map do |entity|
|
27
|
-
if entity.respond_to?(:to_hash)
|
28
|
-
entity.to_hash.merge(SOURCE_CODE_ATTRIBUTE_NAME => entity_source_code(entity))
|
29
|
-
else
|
30
|
-
entity
|
31
|
-
end
|
32
|
-
end
|
33
|
-
else
|
34
|
-
res[var.to_s.gsub("@", "")] = variable
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def merge_source_code_attr(serialized_entries, entities)
|
40
|
-
serialized_entries.map do |serialized|
|
41
|
-
entity = entities.detect { |n| n.id == serialized["id"] }
|
42
|
-
serialized.merge(SOURCE_CODE_ATTRIBUTE_NAME => entity_source_code(entity))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def entity_source_code(entity)
|
47
|
-
Expressir::ExpressExp::Formatter.format(entity)
|
48
|
-
end
|
49
19
|
end
|
50
20
|
end
|
51
21
|
end
|
data/lib/lutaml/version.rb
CHANGED