diff --git a/lib/document.rb b/lib/document.rb index ea4aa0f..529a53b 100644 --- a/lib/document.rb +++ b/lib/document.rb @@ -214,6 +214,7 @@ def to_hash content_type: content_type, filename: pfile.basename.to_s, path: file_path(v, pfile.basename), + size: pfile.size, author: author, created_at: pfile.mtime, } diff --git a/spec/fixtures/document.json b/spec/fixtures/document.json index a46ba1e..9893972 100644 --- a/spec/fixtures/document.json +++ b/spec/fixtures/document.json @@ -9,12 +9,14 @@ "content_type": "application/zip; charset=binary", "filename": "arglebargle.docx", "path": "/document/app/12345/v001/arglebargle.docx", + "size": 12782, "author": "spliffy" }, "txt": { "content_type": "text/plain; charset=us-ascii", "filename": "arglebargle.txt", "path": "/document/app/12345/v001/arglebargle.txt", + "size": 19, "author": "spliffy" } }, @@ -23,12 +25,14 @@ "content_type": "application/zip; charset=binary", "filename": "arglebargle.docx", "path": "/document/app/12345/v002/arglebargle.docx", + "size": 12782, "author": "spliffy" }, "txt": { "content_type": "text/plain; charset=us-ascii", "filename": "arglebargle.txt", "path": "/document/app/12345/v002/arglebargle.txt", + "size": 19, "author": "spliffy" } }