Class: HTTPClient::UploadIO

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/httpclient/uploadio.rb,
lib/httpclient-uploadio/version.rb

Constant Summary collapse

VERSION =
'1.0.1'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, path = '') ⇒ UploadIO

Returns a new instance of UploadIO.



12
13
14
15
# File 'lib/httpclient/uploadio.rb', line 12

def initialize(io, path = '')
  @io = io
  @path = path
end

Instance Attribute Details

#ioObject (readonly)

Returns the value of attribute io.



10
11
12
# File 'lib/httpclient/uploadio.rb', line 10

def io
  @io
end

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/httpclient/uploadio.rb', line 10

def path
  @path
end

Instance Method Details

#content_typeObject



17
18
19
# File 'lib/httpclient/uploadio.rb', line 17

def content_type
  HTTP::Message.mime_type(path)
end