Sha256: 20aa62ea7d77d9dee61fc8fb5b5f8f0c4518155a12a426041e3ccd7bda9c82fb

Contents?: true

Size: 493 Bytes

Versions: 4

Compression:

Stored size: 493 Bytes

Contents

require 'json'
require 'virtus'

require 'vedeu/models/attributes/interface_collection'

module Vedeu
  class Composition
    include Virtus.model

    attribute :interfaces, InterfaceCollection

    def self.enqueue(attributes)
      new(attributes).enqueue
    end

    def enqueue
      interfaces.map { |interface| interface.enqueue }
    end

    def to_json
      {
        interfaces: interfaces
      }.to_json
    end

    def to_s
      interfaces.map(&:to_s).join
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.1.2 lib/vedeu/models/composition.rb
vedeu-0.1.1 lib/vedeu/models/composition.rb
vedeu-0.1.0 lib/vedeu/models/composition.rb
vedeu-0.0.42 lib/vedeu/models/composition.rb