Module: Dipa::Models::Dumpable

Extended by:
ActiveSupport::Concern
Included in:
Agent, Coordinator
Defined in:
app/models/concerns/dipa/models/dumpable.rb

Instance Method Summary collapse

Instance Method Details

#dump_to_file(data:, attacher:) ⇒ Object



8
9
10
11
12
13
# File 'app/models/concerns/dipa/models/dumpable.rb', line 8

def dump_to_file(data:, attacher:)
  io = StringIO.new(Marshal.dump(data), 'rb')
  filename = "#{attacher}.dat"

  __send__(attacher).attach(io: io, filename: filename)
end