load

load(filename = nil) Instance Public methods Loads options from file names as filename. Does nothing when the file is not present. Returns whether successfully loaded. filename defaults to basename of the program without suffix in a directory ~/.options.

to_s

to_s() Instance Public methods

post_form

post_form(url, params) Class Public methods Posts HTML form data to the specified URI object. The form data must be provided as a Hash mapping from String to String. Example: { "cmd" => "search", "q" => "ruby", "max" => "50" } This method also does Basic Authentication iff url.user exists. But userinfo for authentication is deprecated (RFC3986). So this feature will be removed. Example: require 'net/http' require 'uri' Net::HTTP.post_form URI('http://www.example.com/sear

toggle_recurse

toggle_recurse() Instance Public methods

match

match(tuple) Instance Public methods Matches this template against tuple. The tuple must be the same size as the template. An element with a nil value in a template acts as a wildcard, matching any value in the corresponding position in the tuple. Elements of the template match the tuple if the are #== or ===. Template.new([:foo, 5]).match Tuple.new([:foo, 5]) # => true Template.new([:foo, nil]).match Tuple.new([:foo, 5]) # => true Template.new([String]).match Tuple.n

children

children() Instance Public methods

sample

ary.sample â objary.sample(random: rng) â objary.sample(n) â new_aryary.sample(n, random: rng) â new_ary Instance Public methods Choose a random element or n random elements from the array. The elements are chosen by using random and unique indices into the array in order to ensure that an element doesn't repeat itself unless the array already contained duplicate elements. If the array is empty the first form returns nil and the second form retu

new

new(delim, subtype) Class Public methods delim corresponds to the `typdelim` column in the pg_types table. subtype is derived from the `typelem` column in the pg_types table.

read

strio.read([length [, outbuf]]) â string, outbuf, or nil Instance Public methods See IO#read.

default_scope

default_scope(scope = nil) Instance Protected methods Use this macro in your model to set a default scope for all operations on the model. class Article < ActiveRecord::Base default_scope { where(published: true) } end Article.all # => SELECT * FROM articles WHERE published = true The default_scope is also applied while creating/building a record. It is not applied while updating a record. Article.new.published # => true Article.create.published # => true (You c