Sha256: 4ec5aa8033f928832f3dd3fcf88c584057ee974b6f65441bdad30937aa0ac79d

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

module Koine
  module Attributes
    module Adapter
      class ArrayOf < Base
        def initialize(adapter)
          @adapter = adapter
          with_default_value([])
        end

        def for_values
          @adapter
        end

        def with_attribute_name(name)
          @adapter.with_attribute_name(name)
          super(name)
        end

        private

        def coerce_not_nil(collectionOfValues)
          secure do
            collectionOfValues.map { |value| @adapter.coerce(value) }
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
koine-attributes-1.2.3 lib/koine/attributes/adapter/array_of.rb
koine-attributes-1.2.2 lib/koine/attributes/adapter/array_of.rb
koine-attributes-1.2.1 lib/koine/attributes/adapter/array_of.rb