Class: CGSize
- Inherits:
-
Struct
- Object
- Struct
- CGSize
- Defined in:
- lib/accessibility/bridge/mri.rb,
lib/accessibility/bridge/common.rb
Overview
A structure that contains the size of a rectangle in a 2D co-ordinate system
Instance Attribute Summary collapse
-
#height ⇒ Number
The
heighth
of the box. -
#width ⇒ Number
The
width
of the box.
Class Method Summary collapse
-
.ax_value ⇒ Number
Returns the number that AXAPI uses in order to know how to wrap a struct.
Instance Method Summary collapse
-
#initialize(width = 0.0, height = 0.0) ⇒ CGSize
constructor
A new instance of CGSize.
-
#inspect ⇒ String
Return a nice string representation of the size.
-
#to_size ⇒ CGSize
Returns the receiver, since the receiver is already a CGSize.
Constructor Details
#initialize(width = 0.0, height = 0.0) ⇒ CGSize
Returns a new instance of CGSize.
38 39 40 |
# File 'lib/accessibility/bridge/mri.rb', line 38 def initialize width = 0.0, height = 0.0 super end |
Instance Attribute Details
#height ⇒ Number
The heighth
of the box
34 35 36 |
# File 'lib/accessibility/bridge/mri.rb', line 34 def height @height end |
#width ⇒ Number
The width
of the box
34 35 36 |
# File 'lib/accessibility/bridge/mri.rb', line 34 def width @width end |
Class Method Details
.ax_value ⇒ Number
Returns the number that AXAPI uses in order to know how to wrap a struct.
120 |
# File 'lib/accessibility/bridge/macruby.rb', line 120 def ax_value; KAXValueCGSizeType end |
Instance Method Details
#inspect ⇒ String
Return a nice string representation of the size
Overrides Object#inspect
to more closely mimic MacRuby Boxed#inspect
.
56 57 58 |
# File 'lib/accessibility/bridge/mri.rb', line 56 def inspect "#<CGSize width=#{self.width.to_f} height=#{self.height.to_f}>" end |