Class: Object

Inherits:
BasicObject
Defined in:
lib/cfn-nag/rule_repos/s3_based_rule_repo.rb

Instance Method Summary collapse

Instance Method Details

#eval_code_in_object_scope(code) ⇒ Object

This is meta-magic evil. eval apparently has lexical scope so… opening up Object to evaluate ruby code that contains top-level Class definitions

Without this, the class ends up “under” the scope of the class which in this case would be S3BucketBasedRuleRepo

rubocop:disable Security/Eval


19
20
21
# File 'lib/cfn-nag/rule_repos/s3_based_rule_repo.rb', line 19

def eval_code_in_object_scope(code)
  eval code
end