Class: Postsvg::Model::Operators::Font::Xyshow

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/font.rb

Overview

Moves to (x, y) and renders text (PLRM ยง5.5 xyshow variant not implemented here).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postsvg::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/postsvg/model/operators/font.rb', line 73

def initialize(text:, dx:, dy:)
  @text = text
  @dx = dx
  @dy = dy
  freeze
end

Instance Attribute Details

#dxObject (readonly)

Returns the value of attribute dx.



72
73
74
# File 'lib/postsvg/model/operators/font.rb', line 72

def dx
  @dx
end

#dyObject (readonly)

Returns the value of attribute dy.



72
73
74
# File 'lib/postsvg/model/operators/font.rb', line 72

def dy
  @dy
end

#textObject (readonly)

Returns the value of attribute text.



72
73
74
# File 'lib/postsvg/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/postsvg/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