Class: NSObject

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.method_added(name) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/project/object.rb', line 50

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
end

.method_added_motion_accessibilityObject



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

alias :method_added_motion_accessibility :method_added

Instance Method Details

#accessibility_traits=(traits) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/project/object.rb', line 29

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
end