Sha256: 2e48e15436c21004a0cbc2b5fe6c38128bc57e8c80310ddf20a88f73ac66b5e7

Contents?: true

Size: 313 Bytes

Versions: 6

Compression:

Stored size: 313 Bytes

Contents

require 'virtus'

require 'vedeu/support/persistence'

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.1.2 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.1.1 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.1.0 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.42 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.41 lib/vedeu/models/attributes/interface_collection.rb
vedeu-0.0.40 lib/vedeu/models/attributes/interface_collection.rb