class UserData

Public Class Methods

compare(one, another) click to toggle source

Compare the two UserData enums are the same or not. Static method. @param one [String] one UserData type enum @param another [String] another UserDataType enum @return [Boolean] if the two enums or strings are the same

# File lib/openstudio-standards/standards/ashrae_90_1_prm/userdata_csv/userdata_enums.rb, line 23
def self.compare(one, another)
  return one && another && !one.empty? && !another.empty? && one.downcase.strip == another.downcase.strip
end
get_constant_values() click to toggle source

Static method that retrieves the function constant values in a list

# File lib/openstudio-standards/standards/ashrae_90_1_prm/userdata_csv/userdata_enums.rb, line 3
def self.get_constant_values
  return constants.map(&method(:const_get))
end
matched_any?(user_data) click to toggle source

Static method to check if a user data matches to any of the constant value

@param user_data [String] a user data @return [Boolean] matched any, else false

# File lib/openstudio-standards/standards/ashrae_90_1_prm/userdata_csv/userdata_enums.rb, line 11
def self.matched_any?(user_data)
  userdata_constants = get_constant_values
  userdata_constants.each do |constant|
    return true if compare(user_data, constant)
  end
  return false
end