Class: Postscript::Model::Operators::Path::Arcn

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

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(x:, y:, radius:, angle1:, angle2:) ⇒ Arcn

Returns a new instance of Arcn.



141
142
143
144
145
146
147
148
# File 'lib/postscript/model/operators/path.rb', line 141

def initialize(x:, y:, radius:, angle1:, angle2:)
  @x = x
  @y = y
  @radius = radius
  @angle1 = angle1
  @angle2 = angle2
  freeze
end

Instance Attribute Details

#angle1Object (readonly)

Returns the value of attribute angle1.



140
141
142
# File 'lib/postscript/model/operators/path.rb', line 140

def angle1
  @angle1
end

#angle2Object (readonly)

Returns the value of attribute angle2.



140
141
142
# File 'lib/postscript/model/operators/path.rb', line 140

def angle2
  @angle2
end

#radiusObject (readonly)

Returns the value of attribute radius.



140
141
142
# File 'lib/postscript/model/operators/path.rb', line 140

def radius
  @radius
end

#xObject (readonly)

Returns the value of attribute x.



140
141
142
# File 'lib/postscript/model/operators/path.rb', line 140

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



140
141
142
# File 'lib/postscript/model/operators/path.rb', line 140

def y
  @y
end

Class Method Details

.from_operands(stack) ⇒ Object



149
150
151
152
153
154
155
156
# File 'lib/postscript/model/operators/path.rb', line 149

def self.from_operands(stack)
  angle2 = stack.pop_number
  angle1 = stack.pop_number
  radius = stack.pop_number
  y = stack.pop_number
  x = stack.pop_number
  new(x: x, y: y, radius: radius, angle1: angle1, angle2: angle2)
end