truncate

truncate(string, width) Instance Public methods

glob

Dir.glob( pattern, [flags] ) â arrayDir.glob( pattern, [flags] ) {| filename | block } â nil Class Public methods Returns the filenames found by expanding pattern which is an Array of the patterns or the pattern String, either as an array or as parameters to the block. Note that this pattern is not a regexp (it's closer to a shell glob). See File::fnmatch for the meaning of the flags parameter. Note that case sensitivity depends on your system (so File::FNM_CASEFOLD is ignored),

type_cast

type_cast(value) Instance Public methods

have_header

have_header(header, preheaders = nil, opt = "", &b) Instance Public methods Returns whether or not the given header file can be found on your system. If found, a macro is passed as a preprocessor constant to the compiler using the header file name, in uppercase, prepended with HAVE_. For example, if have_header('foo.h') returned true, then the HAVE_FOO_H preprocessor macro would be passed to the compiler.

count

enum.count â intenum.count(item) â intenum.count { |obj| block } â int Instance Public methods Returns the number of items in enum through enumeration. If an argument is given, the number of items in enum that are equal to item are counted. If a block is given, it counts the number of elements yielding a true value. ary = [1, 2, 4, 2] ary.count #=> 4 ary.count(2) #=> 2 ary.count{ |x| x%2==0 } #=> 3

includes

includes(*args) Instance Public methods Specify relationships to be included in the result set. For example: users = User.includes(:address) users.each do |user| user.address.city end allows you to access the address attribute of the User model without firing an additional query. This will often result in a performance improvement over a simple join. You can also specify multiple relationships, like this: users = User.includes(:address, :friends) Loading nested relationships is

new

Regexp.new(string, [options [, kcode]]) â regexpRegexp.new(regexp) â regexpRegexp.compile(string, [options [, kcode]]) â regexpRegexp.compile(regexp) â regexp Class Public methods Constructs a new regular expression from pattern, which can be either a String or a Regexp (in which case that regexp's options are propagated), and new options may not be specified (a change as of Ruby 1.8). If options is a Fixnum, it should be

encoding_name

encoding_name() Class Public methods Also aliased as: encoding, default_encoding

read_s

read_s(name) Instance Public methods Read a REG_SZ(read_s), REG_DWORD(read_i), or REG_BINARY(read_bin) registry value named name. If the values type does not match, TypeError is raised.

new

new(tree, parent, keys={}) Class Public methods