Class: Dvi::Opcode::RuleBase
Overview
RuleBase is a base class for SetRule/PutRule opcodes.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(height, width) ⇒ RuleBase
constructor
A new instance of RuleBase.
- #interpret(ps) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(height, width) ⇒ RuleBase
Returns a new instance of RuleBase.
97 98 99 100 101 102 103 104 105 |
# File 'lib/dvi/opcode.rb', line 97 def initialize(height, width) unless (-2147483648..2147483647).include?(height) and (-2147483648..2147483647).include?(width) raise ArgumentError end @height = height @width = width end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
95 96 97 |
# File 'lib/dvi/opcode.rb', line 95 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
95 96 97 |
# File 'lib/dvi/opcode.rb', line 95 def width @width end |
Class Method Details
.read(cmd, io) ⇒ Object
107 108 109 |
# File 'lib/dvi/opcode.rb', line 107 def self.read(cmd, io) return self.new(io.read_int4, io.read_int4) end |