Sha256: 30772eb789e72e771630bbc5ed1cafcaf2804187b26d40c910e81bb37f99bd4b

Contents?: true

Size: 401 Bytes

Versions: 1

Compression:

Stored size: 401 Bytes

Contents

require 'virtus'

require 'vedeu/api/store'

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

      [values].flatten.map do |buffer_attributes|
        interface_attributes = API::Store.query(buffer_attributes[:name])

        Interface.new(buffer_attributes.merge!(interface_attributes))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.1.8 lib/vedeu/models/attributes/interface_collection.rb