find_each

find_each(options = {}) Instance Public methods Looping through a collection of records from the database (using the all method, for example) is very inefficient since it will try to instantiate all the objects at once. In that case, batch processing methods allow you to work with the records in batches, thereby greatly reducing memory consumption. The find_each method uses find_in_batches with a batch size of 1000 (or as specified by the :batch_size option). Person.find_each do |p

create

create(nb) Class Public methods

_conv_args

_conv_args(*args) Class Public methods

load_stream

load_stream(yaml, filename = nil) Class Public methods Load multiple documents given in yaml. Returns the parsed documents as a list. If a block is given, each document will be converted to ruby and passed to the block during parsing Example: Psych.load_stream("--- foo\n...\n--- bar\n...") # => ['foo', 'bar'] list = [] Psych.load_stream("--- foo\n...\n--- bar\n...") do |ruby| list << ruby end list # => ['foo', 'bar']

delete_if

delete_if( &block ) Instance Public methods

on_etag

on_etag(name) Instance Public methods

start_document

start_document(version, tag_directives, implicit) Instance Public methods Handles #start_document events with version, tag_directives, and implicit styling. See Psych::Handler#start_document

read

read(p1 = v1) Instance Public methods See Zlib::GzipReader documentation for a description.

gets

gets(sep=$/) â string or nilgets(limit) â string or nilgets(sep,limit) â string or nil Instance Public methods Returns (and assigns to $_) the next line from the list of files in ARGV (or $*), or from standard input if no files are present on the command line. Returns nil at end of file. The optional argument specifies the record separator. The separator is included with the contents of each record. A separator of nil reads the entire contents, and a zero-length separator r

new

new() Class Public methods