Class: Postsvg::Model::InvokeProcedure

Inherits:
Operator
  • Object
show all
Defined in:
lib/postsvg/model/operators.rb

Overview

A bare name reference resolved to a user-defined procedure via def. The renderer descends into procedure with the current context, mirroring how PostScript executes the procedure body.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Operator

#accept, from_operands, #operator?, register_as

Constructor Details

#initialize(name:, procedure:) ⇒ InvokeProcedure

Returns a new instance of InvokeProcedure.



78
79
80
81
82
# File 'lib/postsvg/model/operators.rb', line 78

def initialize(name:, procedure:)
  @name = name
  @procedure = procedure
  freeze
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



76
77
78
# File 'lib/postsvg/model/operators.rb', line 76

def name
  @name
end

#procedureObject (readonly)

Returns the value of attribute procedure.



76
77
78
# File 'lib/postsvg/model/operators.rb', line 76

def procedure
  @procedure
end

Instance Method Details

#keywordObject



86
# File 'lib/postsvg/model/operators.rb', line 86

def keyword = name.to_s

#visit_nameObject



84
# File 'lib/postsvg/model/operators.rb', line 84

def visit_name = "invoke_procedure"