Sha256: 0161823e304f50ba59a943f315a447ef8115252574a9166f90d999e9cc17a091
Contents?: true
Size: 913 Bytes
Versions: 19
Compression:
Stored size: 913 Bytes
Contents
module Fiona7 module AttributeReaders module Helpers class LinkDeserializer def call(link) if link deserialized = { # remove possible external prefix for protcol-less urls url: link["url"].try(:gsub, /\Aexternal:/, ''), title: link["title"], target: link["target"], # content service uses destination destination: link["destination"].to_s, # rest api uses obj_id obj_id: link["destination"].to_s, query: link["search"], fragment: link["fragment"] } # TODO: refactor this code if deserialized[:url].present? deserialized.delete(:destination) deserialized.delete(:obj_id) end deserialized end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems