Sha256: 53533bbde297955f41f3562dcb4016685c3350424f5e8c201733fc3111274267

Contents?: true

Size: 342 Bytes

Versions: 6

Compression:

Stored size: 342 Bytes

Contents

require 'virtus'

require_relative '../../repository/interface_repository'

module Vedeu
  class InterfaceCollection < Virtus::Attribute
    def coerce(values)
      return [] if values.nil? || values.empty?

      [values].flatten.map do |value|
        InterfaceRepository.update(value.fetch(:name, nil), value)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.0.39 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.38 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.37 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.36 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.35 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.34 lib/vedeu/models/attributes/interface_collection.rb