Guest User

Untitled

a guest
Feb 28th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. >> class DataMapper::Property;include Extlib::Hook;before(:typecast){|v| @before_typecast=v};attr :before_typecast end
  2. => nil
  3. >> a = User.new
  4. => #<User activated_at=nil activation_code=nil id=nil login=nil name=nil email=nil timezone=nil crypted_password=nil salt=nil>
  5. >> a.id = "hello"
  6. => "hello"
  7. >> a.id
  8. => nil
  9. >> a.send(:properties)[:id]
  10. => #<Property:User:id>
  11. >> a.send(:properties)[:id].before_typecast
  12. => "hello"
Add Comment
Please, Sign In to add comment