validates_format_of

validates_format_of(*attr_names) Instance Public methods Validates whether the value of the specified attribute is of the correct form, going by the regular expression provided.You can require that the attribute matches the regular expression: class Person < ActiveRecord::Base validates_format_of :email, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, on: :create end Alternatively, you can require that the specified attribute does not match the regular expression: class

get_screen_size

Readline.get_screen_size â [rows, columns] Class Public methods Returns the terminal's rows and columns. See GNU Readline's rl_get_screen_size function. Raises NotImplementedError if the using readline library does not support. Raises SecurityError exception if $SAFE is 4.

item_create

item_create(keys={}) Instance Public methods

size

size() Instance Public methods Returns the size of the collection. If the collection hasn't been loaded, it executes a SELECT COUNT(*) query. Else it calls collection.size. If the collection has been already loaded size and length are equivalent. If not and you are going to need the records anyway length will take one less query. Otherwise size is more efficient. class Person < ActiveRecord::Base has_many :pets end person.pets.size # => 3 # executes something like SELECT C

clear

clear() Instance Public methods

lookup_ancestors

lookup_ancestors() Instance Public methods When localizing a string, it goes through the lookup returned by this method, which is used in ActiveModel::Name#human, ActiveModel::Errors#full_messages and #human_attribute_name.

get_option

get_option() Instance Public methods `get_option' is an alias of `get'. get

encoding

encoding() Instance Public methods The external encoding for standard input.

yaxis_use

yaxis_use(target=nil) Instance Public methods

tag

tag(intv_p = false, relname=nil) Instance Public methods