Completed
Push — dev ( 36eb97...6cb2fc )
by Fike
01:01
created

Injector   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 100 %

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
dl 14
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A inject() 3 3 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
# frozen_string_literal: true
2
3
# rubocop:disable Lint/UnusedMethodArgument
4
5
require_relative 'interface'
6
7
module AMA
8
  module Entity
9 View Code Duplication
    class Mapper
1 ignored issue
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10
      module API
11
        # Class that proxies attribute setting on target entity. That allows
12
        # tricks like virtual attribute handling or multi-value attribute
13
        # handling (like in hash or array)
14
        class Injector < Interface
15
          # :nocov:
16
          # Injects passed attribute into entity.
17
          #
18
          # @param [Object] entity
19
          # @param [AMA::Entity::Mapper::Type] type
20
          # @param [AMA::Entity::Mapper::Type::Attribute] attribute
21
          # @param [Object] value
22
          # @param [AMA::Entity::Mapper::Context] context
23
          def inject(entity, type, attribute, value, context = nil)
24
            abstract_method
25
          end
26
          # :nocov:
27
        end
28
      end
29
    end
30
  end
31
end
32