Sha256: 190a7fb69ab3550bc76ea43de0fbf5d0dd7de33c0b37944730565c62ab7de3a9

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

# 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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openstudio-standards-0.2.2 lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb
openstudio-standards-0.2.1 lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb
openstudio-standards-0.2.0 lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb
openstudio-standards-0.2.0.rc2 lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb