class FileMarshal::Loader

Attributes

attributes[R]
file[R]

Public Class Methods

new(opts) click to toggle source
# File lib/file_marshal/loader.rb, line 5
def initialize(opts)
  opts.symbolize_keys!
  @attributes = FileAttributes.new(
    opts[:name], opts[:content], opts[:updated_at]
  )
end

Public Instance Methods

tempfile() click to toggle source
# File lib/file_marshal/loader.rb, line 15
def tempfile
  Writer::Temp.new(attributes).build
end
to_file(path) click to toggle source
# File lib/file_marshal/loader.rb, line 19
def to_file(path)
  Writer::File.new(attributes, path).build
end