Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Recipient
- Maglev::PERSISTENT_ROOT[self] ||= []
- @@root = Maglev::PERSISTENT_ROOT[self]
- class << self
- include Enumerable
- def each
- @@root.each {|x| yield x}
- end
- def count
- @@root.length
- end
- end
- attr_accessor :name, :address
- def initialize(name = nil, address = nil, &block)
- @name = name
- @address = address
- yield self if block
- end
- def save
- Maglev::PERSISTENT_ROOT[self.class] << self
- end
- end
Add Comment
Please, Sign In to add comment