Class: CouchShell::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.



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_typeObject (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

#filenameObject (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