class HexaPDF::Content::Operator::BaseOperator
reasons each operator should provide a custom #serialize method.
A default implementation for the #serialize method is provided. However, for performance
Base class for operator implementations.
def initialize(name)
def initialize(name) @name = name.freeze end
def invoke(*)
Invokes the operator so that it performs its job.
def invoke(*) end
def serialize(serializer, *operands)
Returns the string representation of the operator, i.e.
def serialize(serializer, *operands) result = ''.b operands.each do |operand| result << serializer.serialize(operand) << " " end result << name << "\n" end