Module: Nuggets::Data::UpdateMixin

Defined in:
lib/nuggets/data/update_mixin.rb

Instance Method Summary collapse

Instance Method Details

#update(string) ⇒ Object

call-seq:

DATA.update(string) -> anInteger

Update DATA with string.



35
36
37
38
39
40
41
# 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