Class: Rect

Inherits:
Object
  • Object
show all
Defined in:
lib/classes.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bytes) ⇒ Rect

Returns a new instance of Rect.



65
66
67
# File 'lib/classes.rb', line 65

def initialize(bytes)
    @x, @y, @width, @height = *bytes.unpack('i4')
end

Class Method Details

._load(bytes) ⇒ Object



73
74
75
# File 'lib/classes.rb', line 73

def self._load(bytes)
    new(bytes)
end

Instance Method Details

#_dump(*_ignored) ⇒ Object



69
70
71
# File 'lib/classes.rb', line 69

def _dump(*_ignored)
    [@x, @y, @width, @height].pack('i4')
end