lib/measures/tbd/resources/psi.rb
##
# Return safe PSI type if missing input from PSI set (relies on inheritance)
# @param [String] p A PSI set identifier
# @param [Hash] type PSI type e.g., :rimjoistconcave
#
# @return [Symbol] Returns safe type; nil if none were found
Return safe PSI type if missing input from PSI set (relies on inheritance)
Return safe PSI type if missing input from PSI set ( relies on inheritance )
def safeType(p, type)
    ok = @set.has_key?(p)
    tt = type
    tt = tt.to_sym unless tt.is_a?(Symbol)
    unless @has[p][tt]
      tt_concave = tt.to_s.include?("concave")
      tt_convex  = tt.to_s.include?("convex")
      tt = tt.to_s.chomp("concave").to_sym if tt_concave
      tt = tt.to_s.chomp("convex").to_sym  if tt_convex
      unless @has[p][tt]
        tt = :fenestration if tt == :head
        tt = :fenestration if tt == :sill
        tt = :fenestration if tt == :jamb
      end
    end
    return tt if @has[p][tt]
    nil
  end
def safeType ( p , type ) ok = @set . has_key? ( p ) tt = type tt = tt . to_sym unless tt . is_a? ( Symbol ) unless @has [ p ] [ tt ] tt_concave = tt . to_s . include? ( "concave" ) tt_convex = tt . to_s . include? ( "convex" ) tt = tt . to_s . chomp ( "concave" ) . to_sym if tt_concave tt = tt . to_s . chomp ( "convex" ) . to_sym if tt_convex unless @has [ p ] [ tt ] tt = :fenestration if tt == :head tt = :fenestration if tt == :sill tt = :fenestration if tt == :jamb end end return tt if @has [ p ] [ tt ] nil end
Return safe PSI type if missing input from PSI set (relies on inheritance)
Return safe PSI type if missing input from PSI set ( relies on inheritance )
Returns safe type; nil if none were found
Returns safe type ; nil if none were found
Symbol
p
type
type PSI type e.g., :rimjoistconcave
type PSI type e . g . : rimjoistconcave