Class: WinFFI::RECT
- Defined in:
- lib/win-ffi/structs/rect.rb
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
14 15 16 |
# File 'lib/win-ffi/structs/rect.rb', line 14 def area width * height end |
#height ⇒ Object
30 31 32 |
# File 'lib/win-ffi/structs/rect.rb', line 30 def height bottom - top end |
#height=(v) ⇒ Object
34 35 36 |
# File 'lib/win-ffi/structs/rect.rb', line 34 def height=(v) self.bottom = top + v end |
#perimeter ⇒ Object
18 19 20 |
# File 'lib/win-ffi/structs/rect.rb', line 18 def perimeter 2 * width + 2 * height end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/win-ffi/structs/rect.rb', line 38 def to_s "(left = #{left}, top = #{top}, width = #{width}, height = #{height})" end |
#width ⇒ Object
22 23 24 |
# File 'lib/win-ffi/structs/rect.rb', line 22 def width right - left end |
#width=(v) ⇒ Object
26 27 28 |
# File 'lib/win-ffi/structs/rect.rb', line 26 def width=(v) self.right = left + v end |