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:



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

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

Instance Method Details

#invoke(_processor) ⇒ Object

:nodoc:



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

def invoke(_processor) # :nodoc:
end

#serialize(_serializer) ⇒ Object

An optimized version of the serialization algorithm.

See: BaseOperator#serialize



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

def serialize(_serializer)
  @serialized
end