Class: Array

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

Overview

accessibility-core extensions to the Array class

Instance Method Summary collapse

Instance Method Details

#to_pointCGPoint

Coerce the first two elements of the receiver into a CGPoint

Returns:



70
71
72
# File 'lib/accessibility/bridge/common.rb', line 70

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

#to_rectCGRect

Coerce the first four elements of the receiver into a CGRect

Returns:



86
87
88
# File 'lib/accessibility/bridge/common.rb', line 86

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

#to_rubyObject



190
191
192
# File 'lib/accessibility/bridge/mri.rb', line 190

def to_ruby
  map do |obj| obj.to_ruby end
end

#to_sizeCGSize

Coerce the first two elements of the receiver into a CGSize

Returns:



78
79
80
# File 'lib/accessibility/bridge/common.rb', line 78

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