Class: Postscript::Model::Operators::GraphicsState::Setdash

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/graphics_state.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(pattern:, offset:) ⇒ Setdash

Returns a new instance of Setdash.



70
71
72
73
74
# File 'lib/postscript/model/operators/graphics_state.rb', line 70

def initialize(pattern:, offset:)
  @pattern = pattern
  @offset = offset
  freeze
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



69
70
71
# File 'lib/postscript/model/operators/graphics_state.rb', line 69

def offset
  @offset
end

#patternObject (readonly)

Returns the value of attribute pattern.



69
70
71
# File 'lib/postscript/model/operators/graphics_state.rb', line 69

def pattern
  @pattern
end

Class Method Details

.from_operands(stack) ⇒ Object



75
76
77
78
79
# File 'lib/postscript/model/operators/graphics_state.rb', line 75

def self.from_operands(stack)
  offset = stack.pop_number
  pattern = stack.pop
  new(pattern: pattern, offset: offset)
end