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

ArrayOf.with_attribute_name()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 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