Class: Opine::Rect
- Inherits:
-
Object
- Object
- Opine::Rect
- Defined in:
- lib/opine/rect.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(options) ⇒ Rect
constructor
A new instance of Rect.
- #native ⇒ Object
Constructor Details
#initialize(options) ⇒ Rect
Returns a new instance of Rect.
4 5 6 7 8 |
# File 'lib/opine/rect.rb', line 4 def initialize .each do |key,value| send("#{key}=".to_sym,value) end end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
2 3 4 |
# File 'lib/opine/rect.rb', line 2 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
2 3 4 |
# File 'lib/opine/rect.rb', line 2 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
2 3 4 |
# File 'lib/opine/rect.rb', line 2 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2 3 4 |
# File 'lib/opine/rect.rb', line 2 def y @y end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/opine/rect.rb', line 14 def ==(other) x == other.x && y == other.y && width = other.width && height == other.height end |
#native ⇒ Object
10 11 12 |
# File 'lib/opine/rect.rb', line 10 def native Cocoa::NSRect.new(x: x, y: y, width: width, height: height) end |