Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/accessibility/bridge/common.rb

Overview

accessibility-core extensions to Array

Instance Method Summary collapse

Instance Method Details

#to_pointCGPoint

Coerce the first two elements of the receiver into a CGPoint

Returns:



38
39
40
# File 'lib/accessibility/bridge/common.rb', line 38

def to_point
  CGPoint.new self[0], self[1]
end

#to_rectCGRect

Coerce the first four elements of the receiver into a CGRect

Returns:



54
55
56
# File 'lib/accessibility/bridge/common.rb', line 54

def to_rect
  CGRect.new CGPoint.new(self[0], self[1]), CGSize.new(self[2], self[3])
end

#to_sizeCGSize

Coerce the first two elements of the receiver into a CGSize

Returns:



46
47
48
# File 'lib/accessibility/bridge/common.rb', line 46

def to_size
  CGSize.new self[0], self[1]
end