class Capture include DataMapper::Resource property :id, Serial property :name, String property :contents, Text belongs_to :server, :required => false after :create do self.clear! end def clear! self.contents = '' end def append(data) self.contents << data end end