@@ 45-50 (lines=6) @@ | ||
42 | ctx.logger.debug("Mapping #{source.class} to type #{type.to_def}") |
|
43 | source, reassembled = request_reassembly(source, type, ctx) |
|
44 | epithet = reassembled ? 'reassembled' : 'source' |
|
45 | if type.attributes.empty? |
|
46 | message = "#{type.to_def} has no attributes, " \ |
|
47 | "returning #{epithet} instance" |
|
48 | ctx.logger.debug(message) |
|
49 | return source |
|
50 | end |
|
51 | process_attributes(source, type, ctx) |
|
52 | end |
|
53 |
@@ 40-45 (lines=6) @@ | ||
37 | # @param [AMA::Entity::Mapper::Type] type |
|
38 | # @param [AMA::Entity::Mapper::Context] ctx |
|
39 | def process_attributes(entity, type, ctx) |
|
40 | if type.attributes.empty? |
|
41 | message = "No attributes found on #{type.type}, returning " \ |
|
42 | "#{entity.class} as is" |
|
43 | ctx.logger.debug(message) |
|
44 | return entity |
|
45 | end |
|
46 | normalize_attributes(entity, type, ctx) |
|
47 | end |
|
48 |