Class: HexaPDF::TestUtils::OperatorRecorder
- Inherits:
-
Content::Processor
- Object
- Content::Processor
- HexaPDF::TestUtils::OperatorRecorder
- Defined in:
- lib/hexapdf/test_utils.rb
Overview
Can be used to to record operators parsed from content streams.
Constant Summary
Constants inherited from Content::Processor
Content::Processor::OPERATOR_MESSAGE_NAME_MAP
Instance Attribute Summary collapse
-
#recorded_ops ⇒ Object
readonly
Returns the value of attribute recorded_ops.
Attributes inherited from Content::Processor
#graphics_object, #graphics_state, #operators, #resources
Instance Method Summary collapse
-
#initialize ⇒ OperatorRecorder
constructor
A new instance of OperatorRecorder.
- #method_missing(msg, *params) ⇒ Object
- #respond_to_missing? ⇒ Boolean
Methods inherited from Content::Processor
Constructor Details
#initialize ⇒ OperatorRecorder
Returns a new instance of OperatorRecorder.
51 52 53 54 55 |
# File 'lib/hexapdf/test_utils.rb', line 51 def initialize super operators.clear @recorded_ops = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(msg, *params) ⇒ Object
61 62 63 |
# File 'lib/hexapdf/test_utils.rb', line 61 def method_missing(msg, *params) @recorded_ops << (params.empty? ? [msg] : [msg, params]) end |
Instance Attribute Details
#recorded_ops ⇒ Object (readonly)
Returns the value of attribute recorded_ops.
49 50 51 |
# File 'lib/hexapdf/test_utils.rb', line 49 def recorded_ops @recorded_ops end |
Instance Method Details
#respond_to_missing? ⇒ Boolean
57 58 59 |
# File 'lib/hexapdf/test_utils.rb', line 57 def respond_to_missing?(*) true end |