lib/eco/api/common/people/person_entry.rb in eco-helpers-1.0.3 vs lib/eco/api/common/people/person_entry.rb in eco-helpers-1.0.4
- old
+ new
@@ -338,13 +338,12 @@
# Parsing helper that just **parses the values** that have a parser/serializer defined.
# @param aliased_entry [Hash] the entry with the _internal attribute_ names but the _external values_.
# @return [Hash] the `internal entry` with the **internal** attributes names and values.
def _parsed_entry(aliased_entry)
- parsed = @person_parser.active_attrs(aliased_entry).map do |attr|
- value = @person_parser.parse(attr, aliased_entry)
- [attr, value]
- end.to_h
+ parsed = @person_parser.active_attrs(aliased_entry).each_with_object({}) do |attr, hash|
+ hash[attr] = @person_parser.parse(attr, aliased_entry.merge(hash))
+ end
aliased_entry.merge(parsed)
end
# Serializing helper that just creates the _internal entry_ out of a `Person` object.
# @note