lib/eco/api/common/people/entry_factory.rb in eco-helpers-1.0.11 vs lib/eco/api/common/people/entry_factory.rb in eco-helpers-1.0.12
- old
+ new
@@ -19,16 +19,20 @@
@logger = logger
@schema = Ecoportal::API::V1::PersonSchema.new(JSON.parse(schema.doc.to_json))
@source_person_parser = person_parser
+ # load default parsers
@person_parser = Eco::API::Common::People::DefaultParsers.new(schema: @schema)
+ # merge the custom parsers
@person_parser = @person_parser.merge(@source_person_parser)
@person_parser_patch_version = @source_person_parser.patch_version
@attr_map = attr_map
end
+ # provides with a Eco::API::Common::People::PersonParser object (collection of attribute parsers)
+ # @note if the custom person parser has changed, it updates the copy of this EntryFactory instance
def person_parser
if @person_parser_patch_version < @source_person_parser.patch_version
@person_parser.merge(@source_person_parser)
@person_parser_patch_version = @source_person_parser.patch_version
end