Class: CGSize
- Defined in:
- lib/accessibility/bridge/mri.rb,
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 ⇒ Float
The
heighth
of the box. -
#width ⇒ Float
The
width
of the box.
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.
40 41 42 |
# File 'lib/accessibility/bridge/mri.rb', line 40 def initialize width = 0.0, height = 0.0 super width.to_f, height.to_f end |
Instance Attribute Details
#height ⇒ Float
The heighth
of the box
35 36 37 |
# File 'lib/accessibility/bridge/mri.rb', line 35 def height @height end |
#width ⇒ Float
The width
of the box
35 36 37 |
# File 'lib/accessibility/bridge/mri.rb', line 35 def width @width end |
Instance Method Details
#inspect ⇒ String
Return a nice string representation of the size
Overrides Object#inspect
to more closely mimic MacRuby Boxed#inspect
.
58 59 60 |
# File 'lib/accessibility/bridge/mri.rb', line 58 def inspect "#<CGSize width=#{self.width.to_f} height=#{self.height.to_f}>" end |