Class: Postscript::Model::Operators::Color::Setgray
- Inherits:
-
Postscript::Model::Operator
- Object
- Postscript::Model::Operator
- Postscript::Model::Operators::Color::Setgray
- Defined in:
- lib/postscript/model/operators/color.rb
Instance Attribute Summary collapse
-
#gray ⇒ Object
readonly
Returns the value of attribute gray.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(gray:) ⇒ Setgray
constructor
A new instance of Setgray.
Methods inherited from Postscript::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(gray:) ⇒ Setgray
Returns a new instance of Setgray.
10 11 12 13 |
# File 'lib/postscript/model/operators/color.rb', line 10 def initialize(gray:) @gray = gray freeze end |
Instance Attribute Details
#gray ⇒ Object (readonly)
Returns the value of attribute gray.
9 10 11 |
# File 'lib/postscript/model/operators/color.rb', line 9 def gray @gray end |
Class Method Details
.from_operands(stack) ⇒ Object
14 15 16 |
# File 'lib/postscript/model/operators/color.rb', line 14 def self.from_operands(stack) new(gray: stack.pop_number) end |