diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-15 08:29:08 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-15 08:29:08 +1100 |
commit | 23e434f08fa756e9a8c472a8212c6f72ac92b32b (patch) | |
tree | 467b1a34448c7357c259965dced00e769d3edcf9 /activemodel/lib/active_model | |
parent | 582228e4355de86ef0a6dc9ce41a3f1da37383f0 (diff) | |
download | rails-23e434f08fa756e9a8c472a8212c6f72ac92b32b.tar.gz rails-23e434f08fa756e9a8c472a8212c6f72ac92b32b.tar.bz2 rails-23e434f08fa756e9a8c472a8212c6f72ac92b32b.zip |
ActiveModel::Conversion documentation
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/conversion.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index d5c65920f6..c14a07c7dc 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -1,5 +1,16 @@ module ActiveModel - # Include ActiveModel::Conversion if your object "acts like an ActiveModel model". + # If your object is already designed to implement all of the Active Model featurs + # include this module in your Class. + # + # class MyClass + # include ActiveModel::Conversion + # end + # + # Returns self to the <tt>:to_model</tt> method. + # + # If your model does not act like an Active Model object, then you should define + # <tt>:to_model</tt> yourself returning a proxy object that wraps your object + # with Active Model compliant methods. module Conversion def to_model self |