Class: OpenTracing::Instrumentation::Mongo::SampleSafetyArgumentChecker
- Inherits:
-
Object
- Object
- OpenTracing::Instrumentation::Mongo::SampleSafetyArgumentChecker
- Defined in:
- lib/opentracing/instrumentation/mongo/sample_safety_argument_checker.rb
Overview
SampleSafetyArgumentChecker check argument to safety Draft implementation
Constant Summary collapse
- DEFAULT_SAFE_ARGUMENTS =
[ '$readPreference', '$clusterTime', ].freeze
Instance Attribute Summary collapse
-
#safe_arguments ⇒ Object
readonly
Returns the value of attribute safe_arguments.
Instance Method Summary collapse
-
#argument_safe?(_command_name, argument_path, _argument_value) ⇒ TrueClass, FalseClass
check.
-
#initialize(safe_arguments: DEFAULT_SAFE_ARGUMENTS) ⇒ SampleSafetyArgumentChecker
constructor
A new instance of SampleSafetyArgumentChecker.
Constructor Details
#initialize(safe_arguments: DEFAULT_SAFE_ARGUMENTS) ⇒ SampleSafetyArgumentChecker
Returns a new instance of SampleSafetyArgumentChecker.
16 17 18 |
# File 'lib/opentracing/instrumentation/mongo/sample_safety_argument_checker.rb', line 16 def initialize(safe_arguments: DEFAULT_SAFE_ARGUMENTS) @safe_arguments = safe_arguments end |
Instance Attribute Details
#safe_arguments ⇒ Object (readonly)
Returns the value of attribute safe_arguments.
14 15 16 |
# File 'lib/opentracing/instrumentation/mongo/sample_safety_argument_checker.rb', line 14 def safe_arguments @safe_arguments end |
Instance Method Details
#argument_safe?(_command_name, argument_path, _argument_value) ⇒ TrueClass, FalseClass
check
not should be cleaned. Otherwise return ‘false“.
24 25 26 |
# File 'lib/opentracing/instrumentation/mongo/sample_safety_argument_checker.rb', line 24 def argument_safe?(_command_name, argument_path, _argument_value) safe_arguments.include?(argument_path) end |