Class: NSObject

Inherits:
Object
  • Object
show all
Defined in:
lib/project/test.rb,
lib/project/object.rb,
lib/project/element.rb,
lib/motion-accessibility-console/object.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessibility_testObject

Returns the value of attribute accessibility_test.



443
444
445
# File 'lib/project/test.rb', line 443

def accessibility_test
  @accessibility_test
end

Class Method Details

.method_added(name) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/project/object.rb', line 60

def self.method_added(name)
if self.respond_to?(:method_added_motion_accessibility)
self.method_added_motion_accessibility(name)
end
return if name=~/=$/
attributes=Accessibility::All_Attributes
return unless attributes.flatten.include?(name.to_sym)
if attributes.has_key?(name)
ruby=name
ios=attributes[name]
define_method(ios) {self.send(ruby)}
else
ios=name
ruby=attributes.rassoc(name).first
define_method(ruby) { self.send(ios)}
end
Accessibility.defined_attribute(self,ios)
end

.method_added_motion_accessibilityObject



55
# File 'lib/project/object.rb', line 55

alias :method_added_motion_accessibility :method_added

Instance Method Details

#accessibility_traits=(traits) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/project/object.rb', line 38

def accessibility_traits=(traits)
bits=0
if traits.kind_of?(Fixnum)
bits=traits
elsif traits.kind_of?(Symbol)
bits=traits.accessibility_trait
elsif traits.kind_of?(Array)
traits.each {|trait| bits|=trait.accessibility_trait}
else
raise "Pass a bitmask, a symbol, or an array to accessibility_traits="
end
self.accessibilityTraits=bits
self
end

#accessible?Boolean

Returns:

  • (Boolean)


451
452
453
454
455
456
# File 'lib/project/test.rb', line 451

def accessible?
	A11y::Test::Data[:depth]=0
	result=A11y::Test.run_tests(self)
A11y.doctor if RUBYMOTION_ENV=='test'&&!A11y::Test::Data[:quiet]
result
end

#browse(*args) ⇒ Object Also known as: b



3
4
5
# File 'lib/motion-accessibility-console/object.rb', line 3

def browse(*args)
A11y::Console.browse(*args)
end

#each_accessibility_elementObject



61
62
63
64
# File 'lib/project/element.rb', line 61

def each_accessibility_element
	return unless A11y::Element.container?(self)
	self.accessibility_element_count.times {|n| yield(self.accessibility_element_at_index(n))}
end

#touch(*args) ⇒ Object



9
10
11
# File 'lib/motion-accessibility-console/object.rb', line 9

def touch(*args)
A11y::Console.touch(*args)
end

#view(*args) ⇒ Object Also known as: v



6
7
8
# File 'lib/motion-accessibility-console/object.rb', line 6

def view(*args)
A11y::Console.view(*args)
end