Sha256: ad9e9df9cd75edb1553d2dae2d4e3d6db59d6ff2426dde5a2c3f3a61d0b3ad3f

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

require 'oj'
require 'virtus'

require_relative 'interface_collection'

module Vedeu
  class Composition
    include Virtus.model

    attribute :interfaces, InterfaceCollection

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

    def enqueue
      interfaces.map do |interface|
        interface.enqueue(interface.to_s)
      end
    end

    def to_json
      Oj.dump(attributes, mode: :compat)
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.26 lib/vedeu/models/composition.rb