mattr_accessor

mattr_accessor(*syms, &blk) Instance Public methods Defines both class and instance accessors for class attributes. module HairColors mattr_accessor :hair_colors end class Person include HairColors end Person.hair_colors = [:brown, :black, :blonde, :red] Person.hair_colors # => [:brown, :black, :blonde, :red] Person.new.hair_colors # => [:brown, :black, :blonde, :red] If a subclass changes the value then that would also change the value for parent class. Simila

set_current_section

set_current_section(title, comment) Instance Public methods Sets the current section to a section with title. See also add_section

database_class

database_class() Class Public methods

etag

etag(&etagger) Instance Public methods Allows you to consider additional controller-wide information when generating an etag. For example, if you serve pages tailored depending on who's logged in at the moment, you may want to add the current user id to be part of the etag to prevent authorized displaying of cached pages. class InvoicesController < ApplicationController etag { current_user.try :id } def show # Etag will differ even for the same invoice when it's vie

min_by

enum.min_by { |obj| block } â objenum.min_by â an_enumerator Instance Public methods Returns the object in enum that gives the minimum value from the given block. If no block is given, an enumerator is returned instead. a = %w(albatross dog horse) a.min_by { |x| x.length } #=> "dog"

cloneNode

cloneNode(arg0) Instance Public methods IXMLDOMNode cloneNode BOOL arg0 --- deep [IN]

update_sql

update_sql(sql, name = nil) Instance Public methods Executes an UPDATE query and returns the number of affected tuples.

to_s

to_s(format = :default) Instance Public methods Also aliased as: to_default_s

addch

addch(ch) Class Public methods Add a character ch, with attributes, then advance the cursor. see also the system manual for curs_addch(3)

accepts_nested_attributes_for

accepts_nested_attributes_for(*attr_names) Instance Public methods Defines an attributes writer for the specified association(s). Supported options: :allow_destroy If true, destroys any members from the attributes hash with a _destroy key and a value that evaluates to true (eg. 1, '1', true, or 'true'). This option is off by default. :reject_if Allows you to specify a Proc or a Symbol pointing to a method that checks whether a record should be built for a certain attribute has