Class: HexaPDF::Content::Operator::NoArgumentOperator

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

Overview

A specialized operator class for operators that take no arguments. Provides an optimized #serialize method.

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ NoArgumentOperator

:nodoc:



117
118
119
120
# File 'lib/hexapdf/content/operator.rb', line 117

def initialize(name) #:nodoc:
  super(name)
  @serialized = "#{name}\n"
end

Instance Method Details

#invoke(_processor) ⇒ Object

:nodoc:



122
123
# File 'lib/hexapdf/content/operator.rb', line 122

def invoke(_processor) # :nodoc:
end

#serialize(_serializer) ⇒ Object

An optimized version of the serialization algorithm.

See: BaseOperator#serialize



128
129
130
# File 'lib/hexapdf/content/operator.rb', line 128

def serialize(_serializer)
  @serialized
end