Sha256: 42097f582285a9e4e6af9f18cbd1e220116434d70adc592321767c148fd6a531
Contents?: true
Size: 481 Bytes
Versions: 6
Compression:
Stored size: 481 Bytes
Contents
module Fiveruns::Dash::Store module File def store_file(*uris) uris.each do |uri| directory = uri.path write_to filename(directory) end end def write_to(path) ::File.open(path, 'w') { |f| f.write @payload.to_fjson } end def filename(directory) kind = payload.class.name =~ /(\w+)Payload/ name = kind ? $1 : 'unknown' ::File.join(directory, "#{guid}.#{name}.json") end end end
Version data entries
6 entries across 6 versions & 1 rubygems