Created
February 1, 2009 11:27
-
-
Save genki/55852 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> class DataMapper::Property;include Extlib::Hook;before(:typecast){|v| @before_typecast=v};attr :before_typecast end | |
=> nil | |
>> a = User.new | |
=> #<User activated_at=nil activation_code=nil id=nil login=nil name=nil email=nil timezone=nil crypted_password=nil salt=nil> | |
>> a.id = "hello" | |
=> "hello" | |
>> a.id | |
=> nil | |
>> a.send(:properties)[:id] | |
=> #<Property:User:id> | |
>> a.send(:properties)[:id].before_typecast | |
=> "hello" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment