lib/rbbt/tsv/accessor.rb in rbbt-util-5.13.23 vs lib/rbbt/tsv/accessor.rb in rbbt-util-5.13.24
- old
+ new
@@ -241,11 +241,11 @@
serializer_module = self.serializer_module
super do |key, value|
next if ENTRY_KEYS.include? key
# TODO Update this to be more efficient
- value = serializer_module.load(value) unless serializer_module.nil? or TSV::CleanSerializer == serializer_module
+ value = serializer_module.load(value) unless value.nil? or serializer_module.nil? or TSV::CleanSerializer == serializer_module
# Annotated with Entity and NamedArray
if not @unnamed
if not fields.nil?
case type
@@ -415,16 +415,18 @@
@named_fields ||= NamedArray.setup @fields, @fields, nil, entity_options, entity_templates
end
end
def namespace=(value)
- self.send(:[]=, "__tsv_hash_namespace", value.nil? ? SERIALIZED_NIL : value.to_yaml, true)
+ self.send(:[]=, "__tsv_hash_namespace", value.nil? ? SERIALIZED_NIL : TSV::TSV_SERIALIZER.dump(value), true)
@namespace = value
@entity_options = nil
end
def fields=(value)
- self.send(:[]=, "__tsv_hash_fields", value.nil? ? SERIALIZED_NIL : value.to_yaml, true)
+ clean = true
+ value_ym = value.nil? ? SERIALIZED_NIL : TSV::TSV_SERIALIZER.dump(value)
+ self.send(:[]=, "__tsv_hash_fields", value_ym, clean)
@fields = value
@named_fields = nil
end
def self.zip_fields(list, fields = nil)