Class: Postsvg::Model::Operators::GraphicsState::Setlinewidth

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

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(width:) ⇒ Setlinewidth

Returns a new instance of Setlinewidth.



22
23
24
25
# File 'lib/postsvg/model/operators/graphics_state.rb', line 22

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

Instance Attribute Details

#widthObject (readonly)

Returns the value of attribute width.



21
22
23
# File 'lib/postsvg/model/operators/graphics_state.rb', line 21

def width
  @width
end

Class Method Details

.from_operands(stack) ⇒ Object



26
27
28
# File 'lib/postsvg/model/operators/graphics_state.rb', line 26

def self.from_operands(stack)
  new(width: stack.pop_number)
end