Class: WinFFI::RECT
- Defined in:
- lib/win-ffi/core/struct/rect.rb
Overview
Instance Method Summary collapse
-
#area ⇒ Object
def initialize(left, top, right, bottom) self.left, self.top, self.right, self.bottom = left, top, right, bottom end.
- #height ⇒ Object
- #height=(v) ⇒ Object
- #perimeter ⇒ Object
- #to_s ⇒ Object
- #width ⇒ Object
- #width=(v) ⇒ Object
Methods inherited from FFIStruct
Instance Method Details
#area ⇒ Object
def initialize(left, top, right, bottom)
self.left, self.top, self.right, self.bottom = left, top, right, bottom
end
13 14 15 |
# File 'lib/win-ffi/core/struct/rect.rb', line 13 def area width * height end |
#height ⇒ Object
29 30 31 |
# File 'lib/win-ffi/core/struct/rect.rb', line 29 def height bottom - top end |
#height=(v) ⇒ Object
33 34 35 |
# File 'lib/win-ffi/core/struct/rect.rb', line 33 def height=(v) self.bottom = top + v end |
#perimeter ⇒ Object
17 18 19 |
# File 'lib/win-ffi/core/struct/rect.rb', line 17 def perimeter 2 * width + 2 * height end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/win-ffi/core/struct/rect.rb', line 37 def to_s "(left = #{left}, top = #{top}, width = #{width}, height = #{height})" end |
#width ⇒ Object
21 22 23 |
# File 'lib/win-ffi/core/struct/rect.rb', line 21 def width right - left end |
#width=(v) ⇒ Object
25 26 27 |
# File 'lib/win-ffi/core/struct/rect.rb', line 25 def width=(v) self.right = left + v end |