Extends the module object with module and instance accessors for class
attributes, just like the native attr* accessors for instance attributes.
From active_support/vendor/builder-2.1.2/blankslate.rb
Also, modules included into Object need to be scanned and have their
instance methods removed from blank slate. In theory, modules included into
Kernel would have to be removed as well, but a "feature" of Ruby
prevents late includes into modules from being exposed in the first place.
| Public Methods |
| alias_attribute |
Allows you to make aliases for attributes, which includes getter, setter,
and query methods.
|
| alias_method_chain |
Encapsulates the common pattern of:
|
| append_features |
|
| as_load_path |
|
| attr_accessor_with_default |
Declare an attribute accessor with an initial default return value.
|
| attr_internal |
Alias for #attr_internal_accessor
|
| attr_internal_accessor |
Declare attributes backed by ‘internal’ instance variables
names.
|
| attr_internal_reader |
Declare an attribute reader backed by an internally-named instance
variable.
|
| attr_internal_writer |
Declare an attribute writer backed by an internally-named instance
variable.
|
| const_missing |
Use const_missing to autoload associations so we don’t have to
require_association when using single-table inheritance.
|
| delegate |
Provides a delegate class method to easily expose contained objects’
methods as your own. Pass one or more methods (specified as symbols or
strings) and the name of the target object as the final :to option (also a
symbol or string). At least one method and the :to option are required.
|
| included_in_classes |
|
| local_constant_names |
Returns the names of the constants defined locally rather than the
constants themselves. See local_constants.
|
| local_constants |
|
| local_constants |
Return the constants that have been defined locally by this object and not
in an ancestor. This method is exact if running under Ruby 1.9. In previous
versions it may miss some constants if their definition in some ancestor is
identical to their definition in the receiver.
|
| mattr_accessor |
|
| mattr_reader |
|
| mattr_writer |
|
| parent |
Return the module which contains this one; if this is a root module, such
as +::MyModule+, then Object is returned.
|
| parents |
Return all the parents of this module, ordered from nested outwards. The
receiver is not contained within the result.
|
| unloadable |
|
<code/>and<pre/>for code samples.