Completed
Push — dev ( ffd8f7...ec8098 )
by Fike
51s
created

Enumerable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
dl 0
loc 9
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A supports() 0 3 1
A normalize() 0 3 1
1
# frozen_String_literal: true
2
3
module AMA
4
  module Entity
5
    class Mapper
6
      class Engine
7
        class Normalizer
8
          # Special normalizer for enumerable instances
9
          class Enumerable
10
            def supports(value)
11
              value.is_a?(::Enumerable)
12
            end
13
14
            def normalize(value, *)
15
              value.map(&:itself)
16
            end
17
          end
18
        end
19
      end
20
    end
21
  end
22
end
23