lib/abide_dev_utils/xccdf/diff/benchmark.rb
# Checks if a given object has a matching level. This is done
# via a basic regex match on the object's #level method
# @param obj [AbideDevUtils::XCCDF::Parser::Objects::Profile] the profile object
# @param level [String] a level to check
# @return [TrueClass] if level matches
# @return [FalseClass] if level does not match
Checks if a given object has a matching level. This is done
via a basic regex match on the object's #level method
Checks if a given object has a matching level . This is done via a basic regex match on the object ' s #level method
def valid_level?(obj, level)
          return true if level.nil? || obj.level.nil?
          obj.level.match?(/#{Regexp.escape level}/i)
        end
def valid_level? ( obj , level ) return true if level . nil? || obj . level . nil? obj . level . match? ( / #{ Regexp . escape level } /i ) end
Checks if a given object has a matching level.
Checks if a given object has a matching level .
if level matches
if level matches
TrueClass
if level does not match
if level does not match
FalseClass
obj
the profile object
the profile object
level
a level to check
a level to check