Class: CGPoint
- Defined in:
- lib/accessibility/bridge/mri.rb,
lib/accessibility/bridge/mri.rb,
lib/accessibility/bridge/common.rb
Overview
A structure that contains a point in a two-dimensional coordinate system
Instance Attribute Summary collapse
-
#x ⇒ Float
The
x
co-ordinate of the screen point. -
#y ⇒ Float
The
y
co-ordinate of the screen point.
Instance Method Summary collapse
-
#initialize(x = 0.0, y = 0.0) ⇒ CGPoint
constructor
A new instance of CGPoint.
-
#inspect ⇒ String
Return a nice string representation of the point.
-
#to_point ⇒ CGPoint
Returns the receiver, since the receiver is already a CGPoint.
Constructor Details
#initialize(x = 0.0, y = 0.0) ⇒ CGPoint
Returns a new instance of CGPoint.
8 9 10 |
# File 'lib/accessibility/bridge/mri.rb', line 8 def initialize x = 0.0, y = 0.0 super x.to_f, y.to_f end |
Instance Attribute Details
#x ⇒ Float
The x
co-ordinate of the screen point
3 4 5 |
# File 'lib/accessibility/bridge/mri.rb', line 3 def x @x end |
#y ⇒ Float
The y
co-ordinate of the screen point
3 4 5 |
# File 'lib/accessibility/bridge/mri.rb', line 3 def y @y end |
Instance Method Details
#inspect ⇒ String
Return a nice string representation of the point
Overrides Object#inspect
to more closely mimic MacRuby Boxed#inspect
.
26 27 28 |
# File 'lib/accessibility/bridge/mri.rb', line 26 def inspect "#<CGPoint x=#{self.x.to_f} y=#{self.y.to_f}>" end |