| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # frozen_string_literal: true |
||
| 12 | class Injector < API::Injector |
||
| 13 | include Mixin::Reflection |
||
| 14 | |||
| 15 | INSTANCE = new |
||
| 16 | |||
| 17 | # @param [Object] entity |
||
| 18 | # @param [AMA::Entity::Mapper::Type] _type |
||
| 19 | # @param [AMA::Entity::Mapper::Type::Attribute] attribute |
||
| 20 | # @param [Object] value |
||
| 21 | # @param [AMA::Entity::Mapper::Context] _context |
||
| 22 | def inject(entity, _type, attribute, value, _context = nil) |
||
| 23 | return entity if attribute.virtual |
||
| 24 | set_object_attribute(entity, attribute.name, value) |
||
| 25 | entity |
||
| 26 | end |
||
| 27 | end |
||
| 28 | end |
||
| 33 |