Completed
Push — master ( 927f49...e957a3 )
by Marcelo
02:52
created

ArrayOf   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 4 1
A with_attribute_name() 0 4 1
A for_values() 0 3 1
A coerce_not_nil() 0 5 1
1
module Koine
2
  module Attributes
3
    module Adapter
4
      class ArrayOf < Base
5
        def initialize(adapter)
6
          @adapter = adapter
7
          with_default_value([])
8
        end
9
10
        def for_values
11
          @adapter
12
        end
13
14
        def with_attribute_name(name)
15
          @adapter.with_attribute_name(name)
16
          super(name)
17
        end
18
19
        private
20
21
        def coerce_not_nil(collectionOfValues)
22
          secure do
23
            collectionOfValues.map { |value| @adapter.coerce(value) }
24
          end
25
        end
26
      end
27
    end
28
  end
29
end
30