Sha256: 89af18fb536143b2efea364779f2f35d24ca91cfe2f02155969e27f4d5d60cb4

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 Bytes

Contents

module Vedeu
  module Buffer
    class Composition
      include Virtus.model

      attribute :interface, Array[Buffer::Interface]

      def to_compositor
        interface.inject({}) do |acc, interface|
          acc[interface.name] = interface.to_compositor
          acc
        end
      end

      def to_hash
        Oj.load(to_json)
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.0.25 lib/vedeu/output/buffer/composition.rb
vedeu-0.0.24 lib/vedeu/output/buffer/composition.rb