cattr_reader

cattr_reader(*syms) Instance Public methods Alias for: mattr_reader

cattr_accessor

cattr_accessor(*syms, &blk) Instance Public methods Alias for: mattr_accessor

attr_internal_writer

attr_internal_writer(*attrs) Instance Public methods Declares an attribute writer backed by an internally-named instance variable.

attr_internal_reader

attr_internal_reader(*attrs) Instance Public methods Declares an attribute reader backed by an internally-named instance variable.

attr_internal_accessor

attr_internal_accessor(*attrs) Instance Public methods Declares an attribute reader and writer backed by an internally-named instance variable. attr_internal

attr_internal

attr_internal(*attrs) Instance Public methods Alias for: attr_internal_accessor

anonymous?

anonymous?() Instance Public methods A module may or may not have a name. module M; end M.name # => "M" m = Module.new m.name # => nil A module gets a name when it is first assigned to a constant. Either via the module or class keyword or by an explicit assignment: m = Module.new # creates an anonymous module M = m # => m gets a name here as a side-effect m.name # => "M"

alias_method_chain

alias_method_chain(target, feature) Instance Public methods Encapsulates the common pattern of: alias_method :foo_without_feature, :foo alias_method :foo, :foo_with_feature With this, you simply do: alias_method_chain :foo, :feature And both aliases are set up for you. Query and bang methods (foo?, foo!) keep the same punctuation: alias_method_chain :foo?, :feature is equivalent to alias_method :foo_without_feature?, :foo? alias_method :foo?, :foo_with_feature? so you can safel

alias_attribute

alias_attribute(new_name, old_name) Instance Public methods Allows you to make aliases for attributes, which includes getter, setter, and query methods. class Content < ActiveRecord::Base # has a title attribute end class Email < Content alias_attribute :subject, :title end e = Email.find(1) e.title # => "Superstars" e.subject # => "Superstars" e.subject? # => true e.subject = "Megastars" e.title # => "Megastars"

concerning

concerning(topic, &block) Instance Public methods Define a new concern and mix it in.