Class: UserData
- Inherits:
-
Object
- Object
- UserData
- Defined in:
- lib/openstudio-standards/standards/ashrae_90_1_prm/userdata_csv/userdata_enums.rb
Direct Known Subclasses
UserDataBoolean, UserDataFiles, UserDataHVACBldgType, UserDataNonTradableLightsCategory, UserDataSHWBldgType, UserDataWWRBldgType
Class Method Summary collapse
-
.compare(one, another) ⇒ Boolean
Compare the two UserData enums are the same or not.
-
.get_constant_values ⇒ Object
Static method that retrieves the function constant values in a list.
-
.matched_any?(user_data) ⇒ Boolean
Static method to check if a user data matches to any of the constant value.
Class Method Details
.compare(one, another) ⇒ Boolean
Compare the two UserData enums are the same or not. Static method.
23 24 25 |
# 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 ⇒ Object
Static method that retrieves the function constant values in a list
3 4 5 |
# 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) ⇒ Boolean
Static method to check if a user data matches to any of the constant value
11 12 13 14 15 16 17 |
# 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 |