Class: Lifter::FilePool
- Inherits:
-
Object
- Object
- Lifter::FilePool
- Defined in:
- lib/lifter/file_pool.rb
Instance Method Summary collapse
- #add(file_id, file, opts = {}) ⇒ Object
- #get(file_id) ⇒ Object
-
#initialize ⇒ FilePool
constructor
A new instance of FilePool.
- #remove(file_id) ⇒ Object
Constructor Details
#initialize ⇒ FilePool
Returns a new instance of FilePool.
3 4 5 |
# File 'lib/lifter/file_pool.rb', line 3 def initialize @files = {} end |
Instance Method Details
#add(file_id, file, opts = {}) ⇒ Object
11 12 13 14 |
# File 'lib/lifter/file_pool.rb', line 11 def add(file_id, file, opts = {}) file_upload = FileUpload.new(file, opts) @files[file_id] = file_upload end |
#get(file_id) ⇒ Object
7 8 9 |
# File 'lib/lifter/file_pool.rb', line 7 def get(file_id) @files[file_id] end |
#remove(file_id) ⇒ Object
16 17 18 |
# File 'lib/lifter/file_pool.rb', line 16 def remove(file_id) @files.delete(file_id) end |