# This class holds methods that apply NECB2011 rules. # @ref [References::NECB2011] class NECB2015 < NECB2011 @template = self.new.class.name # rubocop:disable Style/ClassVars register_standard(@template) def initialize super() @template = self.class.name @standards_data = self.load_standards_database_new() end def load_standards_database_new() #load NECB2011 data. super() #replace template to 2015 for all tables. #puts JSON.pretty_generate( @standards_data['tables'] ) @standards_data['tables'].each do |table| puts table['name'] table['table'].each do |row| ["lighting_standard", "ventilation_standard", "template"].each do |item| row[item].gsub!('NECB2011', 'NECB2015') unless row[item].nil? end end end #needed for compatibility of standards database format @standards_data['tables'].each do |table| @standards_data[table['name']] = table end return @standards_data end end