Sha256: 5cc0447c5333c32ad80d9098713cdfeb3fbb3be611ab56b11e0a4fd9b0e7911b
Contents?: true
Size: 674 Bytes
Versions: 119
Compression:
Stored size: 674 Bytes
Contents
class Promethee::Data::Master < Promethee::Data def initialize(data) super data fix_master_integrity end def flat flatten_components @data end protected def fix_master_integrity @data[:version] = 1 unless @data.include? :version @data[:children] = [] unless @data.include? :children end # Takes an array of components and puts every component and their children into a unique flat array def flatten_components(component) flat_components = [component.except(:children)] (component[:children] || []).reduce flat_components do |flat_components, component| flat_components + flatten_components(component) end end end
Version data entries
119 entries across 119 versions & 1 rubygems