Class: Temper::File

Inherits:
Base
  • Object
show all
Defined in:
lib/temper/file.rb

Instance Attribute Summary

Attributes inherited from Base

#content_type, #original_filename

Instance Method Summary collapse

Methods inherited from Base

#fingerprint, #method_missing, #respond_to?

Constructor Details

#initialize(options = {}) ⇒ File

Returns a new instance of File.



3
4
5
6
7
8
9
10
11
# File 'lib/temper/file.rb', line 3

def initialize(options = {})      
  options ||= {}
  @storage = setup_storage(options)
  path = options[:content]
  if path && ::File.exists?(path)
    options[:original_filename] ||= ::File.basename(path) 
  end
  super options    
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Temper::Base

Instance Method Details

#closeObject



13
14
15
# File 'lib/temper/file.rb', line 13

def close
  @storage.close(true)
end