Class: UIAccessibilityElement

Inherits:
Object
  • Object
show all
Defined in:
lib/project/element.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.container?(obj) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/project/element.rb', line 51

def self.container?(obj)
  !obj.accessibility_element_at_index(0).nil?
end

.init_with_accessibility_container(container) ⇒ Object



3
4
5
# File 'lib/project/element.rb', line 3

def self.init_with_accessibility_container(container)
  UIAccessibilityElement.alloc.initWithAccessibilityContainer(container)
end

.method_added(name) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/project/element.rb', line 30

def self.method_added(name)
if self.respond_to?(:method_added_accessibility)
method_added_accessibility(name)
end
return if name=~/=$/
attributes=Accessibility::Element_Attributes
return unless attributes.flatten.grep(%r{name.to_sym})
if attributes.has_key?(name)
ruby=name
ios=attributes[name]
if ios==:accessibilityElementIsFocused
  raise "You cannot define #{ruby}"
end
define_method(ios) {self.send(ruby)}
else
ios=name
ruby=attributes.rassoc(name).first
define_method(ruby) { self.send(ios)}
end
end

Instance Method Details

#method_added_accessibilityObject



27
# File 'lib/project/element.rb', line 27

alias :method_added_accessibility :method_added

#traits=(traits) ⇒ Object



22
23
24
# File 'lib/project/element.rb', line 22

def traits=(traits)
  self.accessibility_traits=traits
end