ArrayType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 4 1
1
# frozen_string_literal: true
2
3
require_relative 'enumerable_type'
4
5
module AMA
6
  module Entity
7
    class Mapper
8
      class Type
9
        module BuiltIn
10
          # Even though it is functionally unnecessary, end users are more
11
          # likely to call `Mapper.map(input, Array)` rather than
12
          # `Mapper.map(input, Enumerable)`. Because mapper has no right to
13
          # make assumptions about type children, it would have to back off to
14
          # standard hash-based normalization/denormalization, and that would
15
          # cause end-user frustration
16
          class ArrayType < EnumerableType
17
            def initialize
18
              super
19
              self.type = Array
20
            end
21
22
            INSTANCE = new
23
          end
24
        end
25
      end
26
    end
27
  end
28
end
29