Class: CouchShell::Shell::FileToUpload

Inherits:
Object
  • Object
show all
Defined in:
lib/couch-shell/shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, content_type = nil) ⇒ FileToUpload

Returns a new instance of FileToUpload.



36
37
38
39
# File 'lib/couch-shell/shell.rb', line 36

def initialize(filename, content_type = nil)
  @filename = filename
  @content_type = content_type
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



34
35
36
# File 'lib/couch-shell/shell.rb', line 34

def content_type
  @content_type
end

#filenameObject (readonly)

Returns the value of attribute filename.



34
35
36
# File 'lib/couch-shell/shell.rb', line 34

def filename
  @filename
end

Instance Method Details

#content_type!Object



41
42
43
44
# File 'lib/couch-shell/shell.rb', line 41

def content_type!
  # TODO: use mime-types and/or file to guess mime type
  content_type || "application/octet-stream"
end