Class: WinFFI::RECT

Inherits:
FFIAdditions::Struct show all
Defined in:
lib/win-ffi/core/struct/rect.rb

Overview

Instance Method Summary collapse

Methods inherited from FFIAdditions::Struct

encoded_setter

Instance Method Details

#==(other) ⇒ Object



31
32
33
34
# File 'lib/win-ffi/core/struct/rect.rb', line 31

def ==(other)
  return false unless other.is_a?(self.class)
  left == other.left &&  top == other.top && right == other.right&& bottom == other.bottom
end

#heightObject



19
20
21
# File 'lib/win-ffi/core/struct/rect.rb', line 19

def height
  bottom - top
end

#height=(v) ⇒ Object



23
24
25
# File 'lib/win-ffi/core/struct/rect.rb', line 23

def height=(v)
  self.bottom = top + v
end

#to_sObject



27
28
29
# File 'lib/win-ffi/core/struct/rect.rb', line 27

def to_s
  "(left = #{left}, top = #{top}, width = #{right - left}, height = #{bottom - top})"
end

#widthObject



11
12
13
# File 'lib/win-ffi/core/struct/rect.rb', line 11

def width
  right - left
end

#width=(v) ⇒ Object



15
16
17
# File 'lib/win-ffi/core/struct/rect.rb', line 15

def width=(v)
  self.right = left + v
end