Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> 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"
Add Comment
Please, Sign In to add comment