diff options
author | Xavier Noria <fxn@hashref.com> | 2008-05-02 14:45:23 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-02 14:45:23 +0100 |
commit | 64092de25727c1943807bf5345107d90428135a0 (patch) | |
tree | 87977e3b0c839fb6adb417949676bb5384155526 /activesupport/lib/active_support/core_ext/module/delegation.rb | |
parent | 87ec72bd8c4b5d178ba7a41e605bc9a8e27f9e67 (diff) | |
download | rails-64092de25727c1943807bf5345107d90428135a0.tar.gz rails-64092de25727c1943807bf5345107d90428135a0.tar.bz2 rails-64092de25727c1943807bf5345107d90428135a0.zip |
Improve documentation coverage and markup
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/delegation.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index f6647eaed3..e0b5f3e379 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -1,8 +1,8 @@ class Module # 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. + # and the name of the target object as the final <tt>:to</tt> option (also a symbol + # or string). At least one method and the <tt>:to</tt> option are required. # # Delegation is particularly useful with Active Record associations: # @@ -20,6 +20,7 @@ class Module # Foo.new.goodbye # => NoMethodError: undefined method `goodbye' for #<Foo:0x1af30c> # # Multiple delegates to the same target are allowed: + # # class Foo < ActiveRecord::Base # belongs_to :greeter # delegate :hello, :goodbye, :to => :greeter @@ -28,7 +29,8 @@ class Module # Foo.new.goodbye # => "goodbye" # # Methods can be delegated to instance variables, class variables, or constants - # by providing the variable as a symbol: + # by providing them as a symbols: + # # class Foo # CONSTANT_ARRAY = [0,1,2,3] # @@class_array = [4,5,6,7] |