Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Persistent
- def save
- File.open("#{self.class.name}.#{self.object.id}.txt", 'w') { |f|
- f.write(to.s)
- }
- end
- end
- class Employee
- include Persistent
- attr.accessor :name
- def initialize(name)
- @name = name
- end
- end
Add Comment
Please, Sign In to add comment