Class: Postscript::Model::Operators::Font::Show

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/font.rb

Overview

Renders text at the current point using the current font.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postscript::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(text:) ⇒ Show

Returns a new instance of Show.



59
60
61
62
# File 'lib/postscript/model/operators/font.rb', line 59

def initialize(text:)
  @text = text
  freeze
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



58
59
60
# File 'lib/postscript/model/operators/font.rb', line 58

def text
  @text
end

Class Method Details

.from_operands(stack) ⇒ Object



63
64
65
# File 'lib/postscript/model/operators/font.rb', line 63

def self.from_operands(stack)
  new(text: stack.pop)
end