Class: String

Inherits:
Object show all
Defined in:
lib/accessibility/bridge/mri.rb

Overview

accessibility-core extensions to the String class

Instance Method Summary collapse

Instance Method Details

#to_dataObject

misc freedom patches



712
713
714
715
716
717
718
719
720
721
722
# File 'ext/accessibility/bridge/bridge.c', line 712

static
VALUE
rb_str_to_data(const VALUE self)
{
    VALUE self_string = self;
    NSData* const data = [NSData dataWithBytes:(void*)StringValuePtr(self_string)
                                        length:RSTRING_LEN(self)];
    if (data)
        return wrap_nsdata(data);
    return Qnil; // I don't think this is possible except in case of ENOMEM
}

#to_urlURI::Generic

Parse the receiver into a URI object

Returns:



151
152
153
# File 'lib/accessibility/bridge/mri.rb', line 151

def to_url
  URI.parse self
end