Class: CouchShell::FileToUpload
- Inherits:
-
Object
- Object
- CouchShell::FileToUpload
- Defined in:
- lib/couch-shell/shell.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #content_type! ⇒ Object
-
#initialize(filename, content_type = nil) ⇒ FileToUpload
constructor
A new instance of FileToUpload.
Constructor Details
#initialize(filename, content_type = nil) ⇒ FileToUpload
Returns a new instance of FileToUpload.
24 25 26 27 |
# File 'lib/couch-shell/shell.rb', line 24 def initialize(filename, content_type = nil) @filename = filename @content_type = content_type end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
22 23 24 |
# File 'lib/couch-shell/shell.rb', line 22 def content_type @content_type end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
22 23 24 |
# File 'lib/couch-shell/shell.rb', line 22 def filename @filename end |
Instance Method Details
#content_type! ⇒ Object
29 30 31 32 |
# File 'lib/couch-shell/shell.rb', line 29 def content_type! # TODO: use mime-types and/or file to guess mime type content_type || "application/octet-stream" end |