module Diagnostics class DataGroup def elements @elements ||= Data::Elements.new end def attributes(format = nil) elements.attributes(format) end def lists(format = nil) elements.lists(format) end def texts(format = nil) elements.texts(format) end def tables(format = nil) elements.tables(format) end def []=(key, value) attributes << Data::Attribute.new(key, value) end def <<(object) case object when Array then lists << Data::List.new(object) when String then texts << Data::Text.new(object) when Hash then tables << Data::Table.new(object) end end end end