class FileMarshal::Writer

Attributes

attributes[R]
file[R]

Public Class Methods

new(attributes) click to toggle source
# File lib/file_marshal/writer.rb, line 5
def initialize(attributes)
  @attributes = attributes
end

Public Instance Methods

build() click to toggle source
# File lib/file_marshal/writer.rb, line 12
def build
  write
  set_time
  prepare
end
prepare() click to toggle source
# File lib/file_marshal/writer.rb, line 31
def prepare
  file.rewind
  file
end
set_time() click to toggle source
# File lib/file_marshal/writer.rb, line 27
def set_time
  ::File.utime(file.atime, Time.parse(updated_at), file.path)
end
write() click to toggle source
# File lib/file_marshal/writer.rb, line 22
def write
  file.write(content)
  file
end