5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/fiona7/attribute_readers/helpers/link_deserializer.rb', line 5
def call(link)
if link
deserialized = {
url: link["url"].try(:gsub, /\Aexternal:/, ''),
title: link["title"],
target: link["target"],
destination: link["destination"].to_s,
obj_id: link["destination"].to_s,
query: link["search"],
fragment: link["fragment"]
}
if deserialized[:url].present?
deserialized.delete(:destination)
deserialized.delete(:obj_id)
end
deserialized
end
end
|