Class: Object

Inherits:
BasicObject
Defined in:
lib/accessibility/bridge/mri.rb

Overview

accessibility-core extensions to the Object class

Instance Method Summary collapse

Instance Method Details

#descriptionString

An alias for Object#inspect

This exists to help make code more compatible between MacRuby and CRuby.

Returns:



181
182
183
# File 'lib/accessibility/bridge/mri.rb', line 181

def description
  inspect
end

#load_plist(plist_data) ⇒ Object



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'ext/accessibility/extras/extras.c', line 440

static
VALUE
rb_load_plist(VALUE self, VALUE plist_data)
{
  NSData* data = [NSData dataWithBytes:(void*)StringValueCStr(plist_data)
		                length:RSTRING_LEN(plist_data)];
  NSError* err = nil;
  id     plist = [NSPropertyListSerialization propertyListWithData:data
                     	                                   options:0
		                                            format:nil
       	                                                     error:&err];
  [data release];
  if (plist) {
    VALUE list = to_ruby(plist);
    [plist release];
    return list;
  }

  rb_raise(rb_eArgError, "error loading property list: '%s'",
	   [[err localizedDescription] UTF8String]);
  return Qnil; // unreachable
}

#NSContainsRect(outer, inner) ⇒ Boolean

Whether or not the outer rect completely encloses the inner rect

Parameters:

Returns:

  • (Boolean)


170
171
172
# File 'lib/accessibility/bridge/mri.rb', line 170

def NSContainsRect outer, inner
  outer.to_rect.contains? inner
end

#spin(, self) ⇒ Object



725
726
727
728
729
730
731
732
733
734
# File 'ext/accessibility/bridge/bridge.c', line 725

static VALUE
rb_spin(const int argc, VALUE* const argv, const VALUE self)
{
    if (argc == 0)
        spin(0);
    else
        spin(NUM2DBL(argv[0]));

    return self;
}

#to_rubyObject



160
161
162
# File 'lib/accessibility/bridge/mri.rb', line 160

def to_ruby
  self
end