Method: EntityCache::Controls::Store::External::Example#put
- Defined in:
- lib/entity_cache/controls/store/external/example.rb
#put(id, entity, version, time) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/entity_cache/controls/store/external/example.rb', line 30 def put(id, entity, version, time) path = path(id) entity_data = Transform::Write.raw_data(entity) time_iso8601 = Clock.iso8601(time) data = [ entity_data, version, time_iso8601 ] text = JSON.generate(data) FileUtils.mkdir_p(External.file_dump_directory) File.write(path, text) end |