module Nuggets::Data::UpdateMixin

Public Instance Methods

update(string) → anInteger click to toggle source

Update DATA with string.

# File lib/nuggets/data/update_mixin.rb, line 35
def update(string)
  File.open(self, 'r+') { |io|
    io.seek(pos)
    io.truncate(pos)
    io.write(string)
  }
end