extending

extending(*modules, &block) Instance Public methods Used to extend a scope with additional methods, either through a module or through a block provided. The object returned is a relation, which can be further extended. Using a module module Pagination def page(number) # pagination code goes here end end scope = Model.all.extending(Pagination) scope.page(params[:page]) You can also pass a list of modules: scope = Model.all.extending(Pagination, SomethingElse) Using a

try!

try!(*args) Instance Public methods

parent_item

parent_item(item) Instance Public methods

new

new(env = {}) Class Public methods

succ

fixnum.next â integerfixnum.succ â integer Instance Public methods Returns the Integer equal to int + 1. 1.next #=> 2 (-1).next #=> 0

detach

Process.detach(pid) â thread Class Public methods Some operating systems retain the status of terminated child processes until the parent collects that status (normally using some variant of wait(). If the parent never collects this status, the child stays around as a zombie process. Process::detach prevents this by setting up a separate Ruby thread whose sole job is to reap the status of the process pid when it terminates. Use detach only when you do not intent to explicitly wa

next_value

next_value() Instance Public methods

ciphers

ciphers() Instance Public methods

singularize

singularize(word, locale = :en) Instance Public methods The reverse of pluralize, returns the singular form of a word in a string. If passed an optional locale parameter, the word will be singularized using rules defined for that language. By default, this parameter is set to :en. 'posts'.singularize # => "post" 'octopi'.singularize # => "octopus" 'sheep'.singularize # => "sheep" 'word'.singularize # => "word" 'CamelOctopi'.si

gets

gets() Instance Public methods Reads the next line from this input method. See IO#gets for more information.