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

Engine

Complexity

Total Complexity 0

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 11
Bugs 0 Features 0
Metric Value
wmc 0
c 11
b 0
f 0
dl 0
loc 27

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Primitive.supports() 0 5 1
A Primitive.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
          # Primitive data structures serializer
9
          class Primitive
10
            CLASSES = [
11
              String,
12
              Symbol,
13
              Numeric,
14
              TrueClass,
15
              FalseClass,
16
              Array,
17
              Hash,
18
              NilClass
19
            ].freeze
20
21
            def supports(value)
22
              CLASSES.any? do |klass|
23
                value.is_a?(klass)
24
              end
25
            end
26
27
            def normalize(value, *)
28
              value
29
            end
30
          end
31
        end
32
      end
33
    end
34
  end
35
end
36