Class: HexaPDF::Content::Operator::SingleNumericArgumentOperator

Inherits:
BaseOperator
  • Object
show all
Defined in:
lib/hexapdf/content/operator.rb

Overview

A specialized operator class for operators that take a single numeric argument. Provides an optimized #serialize method.

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Methods inherited from BaseOperator

#initialize, #invoke

Constructor Details

This class inherits a constructor from HexaPDF::Content::Operator::BaseOperator

Instance Method Details

#serialize(serializer, arg) ⇒ Object

An optimized version of the serialization algorithm.

See: BaseOperator#serialize



141
142
143
# File 'lib/hexapdf/content/operator.rb', line 141

def serialize(serializer, arg)
  "#{serializer.serialize_numeric(arg)} #{name}\n"
end