Class: Flickr::SanitizedFile
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Flickr::SanitizedFile
- 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
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(original) ⇒ SanitizedFile
constructor
A new instance of SanitizedFile.
Constructor Details
#initialize(original) ⇒ SanitizedFile
Returns a new instance of SanitizedFile.
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_type ⇒ Object (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 |
#file ⇒ Object (readonly)
Returns the value of attribute file.
14 15 16 |
# File 'lib/flickr/sanitized_file.rb', line 14 def file @file end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
14 15 16 |
# File 'lib/flickr/sanitized_file.rb', line 14 def path @path end |