lib/abide_dev_utils/xccdf/diff/benchmark.rb
def valid_profile?(obj, profile)
          return true if profile.nil?

          obj.title.to_s.match?(/#{Regexp.escape profile}/i) ||
            obj.to_s.match?(/#{Regexp.escape profile}/i)
        end
# Checks if a given profile object has a matching title or id. This
# is done with a regex match against the profile's title as a string
# or against it's object string representation (the ID).
# @param obj [AbideDevUtils::XCCDF::Parser::Objects::Profile] the profile object
# @param profile [String] a profile string to check
# @return [TrueClass] if `profile` matches either the profile's title or ID
# @return [FalseClass] if `profile` matches neither
Checks if a given profile object has a matching title or id. This
is done with a regex match against the profile's title as a string
or against it's object string representation (the ID).
Checks if a given profile object has a matching title or id . This is done with a regex match against the profile ' s title as a string or against it ' s object string representation ( the ID ) .
def valid_profile?(obj, profile)
          return true if profile.nil?
          obj.title.to_s.match?(/#{Regexp.escape profile}/i) ||
            obj.to_s.match?(/#{Regexp.escape profile}/i)
        end
def valid_profile? ( obj , profile ) return true if profile . nil? obj . title . to_s . match? ( / #{ Regexp . escape profile } /i ) || obj . to_s . match? ( / #{ Regexp . escape profile } /i ) end
Checks if a given profile object has a matching title or id.
Checks if a given profile object has a matching title or id .
if `profile` matches either the profile's title or ID
if ` profile ` matches either the profile ' s title or ID
TrueClass
if `profile` matches neither
if ` profile ` matches neither
FalseClass
obj
the profile object
the profile object
profile
a profile string to check
a profile string to check