try_type

try_type(type, headers = nil, opt = "", &b) Instance Public methods Returns whether or not the static type type is defined. See also have_type

with_config

with_config(config, default=nil) Instance Public methods Tests for the presence of a --with-config or --without-config option. Returns true if the with option is given, false if the without option is given, and the default value otherwise. This can be useful for adding custom definitions, such as debug information. Example: if with_config("debug") $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG" end

dump

dump( obj [, anIO] , limit=-1 ) â anIO Class Public methods Serializes obj and all descendant objects. If anIO is specified, the serialized data will be written to it, otherwise the data will be returned as a String. If limit is specified, the traversal of subobjects will be limited to that depth. If limit is negative, no checking of depth will be performed. class Klass def initialize(str) @str = str end def say_hello @str end end (produces no output) o = Klass.ne

load

load( source [, proc] ) â obj Class Public methods Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str. If proc is specified, it will be passed each object as it is deserialized. Never pass untrusted data (including user supplied input) to this method. Please see the overview for further details.

restore

restore( source [, proc] ) â obj Class Public methods Returns the result of converting the serialized data in source into a Ruby object (possibly with associated subordinate objects). source may be either an instance of IO or an object that responds to to_str. If proc is specified, it will be passed each object as it is deserialized. Never pass untrusted data (including user supplied input) to this method. Please see the overview for further details.

==

mtch == mtch2 â true or false Instance Public methods EqualityâTwo matchdata are equal if their target strings, patterns, and matched positions are identical.

[]

mtch[i] â str or nilmtch[start, length] â arraymtch[range] â arraymtch[name] â str or nil Instance Public methods Match Reference â MatchData acts as an array, and may be accessed using the normal array indexing techniques. mtch[0] is equivalent to the special variable $&, and returns the entire matched string. mtch[1], mtch[2], and so on return the values of the matched backreferences (portions of the pattern between parentheses). m = /(

begin

mtch.begin(n) â integer Instance Public methods Returns the offset of the start of the nth element of the match array in the string. n can be a string or symbol to reference a named capture. m = /(.)(.)(\d+)(\d)/.match("THX1138.") m.begin(0) #=> 1 m.begin(2) #=> 2 m = /(?<foo>.)(.)(?<bar>.)/.match("hoge") p m.begin(:foo) #=> 0 p m.begin(:bar) #=> 2

captures

mtch.captures â array Instance Public methods Returns the array of captures; equivalent to mtch.to_a[1..-1]. f1,f2,f3,f4 = /(.)(.)(\d+)(\d)/.match("THX1138.").captures f1 #=> "H" f2 #=> "X" f3 #=> "113" f4 #=> "8"

end

mtch.end(n) â integer Instance Public methods Returns the offset of the character immediately following the end of the nth element of the match array in the string. n can be a string or symbol to reference a named capture. m = /(.)(.)(\d+)(\d)/.match("THX1138.") m.end(0) #=> 7 m.end(2) #=> 3 m = /(?<foo>.)(.)(?<bar>.)/.match("hoge") p m.end(:foo) #=> 1 p m.end(:bar) #=> 3