Class: NSBundle

Inherits:
Object show all
Defined in:
ext/accessibility/extras/extras.c,
ext/accessibility/extras/extras.c

Overview

A tiny subset of Cocoa's NSBundle class. Methods that might be useful to have have been bridged.

See Apple's Developer Reference for documentation on the methods available in this class.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.bundleWithURL(url) ⇒ Object



403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'ext/accessibility/extras/extras.c', line 403

static
VALUE
rb_bundle_with_url(VALUE self, VALUE url)
{
  NSURL*     nsurl = unwrap_nsurl(url);
  NSBundle* bundle = [NSBundle bundleWithURL:nsurl];
  VALUE  rb_bundle = Qnil;

  if (bundle)
    rb_bundle = wrap_bundle(bundle);

  return rb_bundle;
}

Instance Method Details

#infoDictionaryObject



417
418
419
420
421
422
423
424
425
426
# File 'ext/accessibility/extras/extras.c', line 417

static
VALUE
rb_bundle_info_dict(VALUE self)
{
  NSDictionary* dict = [unwrap_bundle(self) infoDictionary];
  VALUE         hash = Qnil;
  if (dict)
    hash = wrap_dictionary(dict);
  return hash;
}

#objectForInfoDictionaryKey(key) ⇒ Object



428
429
430
431
432
433
434
435
436
437
# File 'ext/accessibility/extras/extras.c', line 428

static
VALUE
rb_bundle_object_for_info_dict_key(VALUE self, VALUE key)
{
  NSString* nskey = unwrap_nsstring(key);
  id obj = [unwrap_bundle(self) objectForInfoDictionaryKey:nskey];
  if (obj)
    return to_ruby(obj);
  return Qnil;
}