Class: Postscript::Model::Operators::Font::Xyshow
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Font::Xyshow
- Defined in:
- lib/postscript/model/operators/font.rb
Overview
Moves to (x, y) and renders text (PLRM ยง5.5 xyshow
variant not implemented here).
Instance Attribute Summary collapse
-
#dx ⇒ Object
readonly
Returns the value of attribute dx.
-
#dy ⇒ Object
readonly
Returns the value of attribute dy.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text:, dx:, dy:) ⇒ Xyshow
constructor
A new instance of Xyshow.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(text:, dx:, dy:) ⇒ Xyshow
Returns a new instance of Xyshow.
73 74 75 76 77 78 |
# File 'lib/postscript/model/operators/font.rb', line 73 def initialize(text:, dx:, dy:) @text = text @dx = dx @dy = dy freeze end |
Instance Attribute Details
#dx ⇒ Object (readonly)
Returns the value of attribute dx.
72 73 74 |
# File 'lib/postscript/model/operators/font.rb', line 72 def dx @dx end |
#dy ⇒ Object (readonly)
Returns the value of attribute dy.
72 73 74 |
# File 'lib/postscript/model/operators/font.rb', line 72 def dy @dy end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
72 73 74 |
# File 'lib/postscript/model/operators/font.rb', line 72 def text @text end |
Class Method Details
.from_operands(stack) ⇒ Object
79 80 81 82 83 84 |
# File 'lib/postscript/model/operators/font.rb', line 79 def self.from_operands(stack) dy = stack.pop dx = stack.pop text = stack.pop new(text: text, dx: dx, dy: dy) end |