Class: RubstApi::UploadFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rubst_api/params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:, io:, content_type: "application/octet-stream", headers: {}) ⇒ UploadFile

Returns a new instance of UploadFile.



35
36
37
# File 'lib/rubst_api/params.rb', line 35

def initialize(filename:, io:, content_type: "application/octet-stream", headers: {})
  @filename, @io, @content_type, @headers = filename, io, content_type, headers
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



34
35
36
# File 'lib/rubst_api/params.rb', line 34

def content_type
  @content_type
end

#filenameObject (readonly)

Returns the value of attribute filename.



34
35
36
# File 'lib/rubst_api/params.rb', line 34

def filename
  @filename
end

#headersObject (readonly)

Returns the value of attribute headers.



34
35
36
# File 'lib/rubst_api/params.rb', line 34

def headers
  @headers
end

#ioObject (readonly)

Returns the value of attribute io.



34
35
36
# File 'lib/rubst_api/params.rb', line 34

def io
  @io
end

Instance Method Details

#closeObject



40
# File 'lib/rubst_api/params.rb', line 40

def close = io.close

#readObject



38
# File 'lib/rubst_api/params.rb', line 38

def read(...) = io.read(...)

#rewindObject



39
# File 'lib/rubst_api/params.rb', line 39

def rewind = io.rewind

#sizeObject



41
# File 'lib/rubst_api/params.rb', line 41

def size = io.size