Class: Compositor::Renderer::Merged

Inherits:
Base
  • Object
show all
Defined in:
lib/compositor/renderer/merged.rb

Instance Attribute Summary

Attributes inherited from Base

#collection, #composite

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Compositor::Renderer::Base

Instance Method Details

#renderObject



4
5
6
7
8
9
10
11
12
# File 'lib/compositor/renderer/merged.rb', line 4

def render
  return {} if collection.nil? or collection.size == 0
  return collection.first.to_hash if collection.length == 1
  result = {}
  collection.each do |hash|
    result.merge!(hash.to_hash)
  end
  result
end