Class: Range

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

Overview

AXElements extensions for Range.

Instance Method Summary collapse

Instance Method Details

#to_axAXValueRef

Returns:

  • (AXValueRef)

Raises:

  • (ArgumentError)


922
923
924
925
926
927
928
929
930
# File 'lib/accessibility/core.rb', line 922

def to_ax
  raise ArgumentError if last < 0 || first < 0
  length = if exclude_end?
             last - first
           else
             last - first + 1
           end
  CFRange.new(first, length).to_ax
end