Class: Flickr::SanitizedFile

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/flickr/sanitized_file.rb

Overview

File that users provide for uploading can come from various sources (Rails, Sinatra etc). This class attempts to sanitize it, pulling out the path, content type, and the actual file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original) ⇒ SanitizedFile

Returns a new instance of SanitizedFile.

Parameters:



19
20
21
22
23
# File 'lib/flickr/sanitized_file.rb', line 19

def initialize(original)
  @original = original
  sanitize!
  super(@file)
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



14
15
16
# File 'lib/flickr/sanitized_file.rb', line 14

def content_type
  @content_type
end

#fileObject (readonly)

Returns the value of attribute file.



14
15
16
# File 'lib/flickr/sanitized_file.rb', line 14

def file
  @file
end

#pathObject (readonly)

Returns the value of attribute path.



14
15
16
# File 'lib/flickr/sanitized_file.rb', line 14

def path
  @path
end