Class: Ipfs::FileUploadRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/ruby-ipfs-http-client/request/file_upload_request.rb

Instance Attribute Summary

Attributes inherited from Request

#path, #verb

Instance Method Summary collapse

Constructor Details

#initialize(path, filepath) ⇒ FileUploadRequest

Returns a new instance of FileUploadRequest.



5
6
7
8
9
# File 'lib/ruby-ipfs-http-client/request/file_upload_request.rb', line 5

def initialize(path, filepath)
  super(path, :post)

  @filepath = filepath
end

Instance Method Details

#optionsObject



11
12
13
14
15
16
17
# File 'lib/ruby-ipfs-http-client/request/file_upload_request.rb', line 11

def options
  {
    form: {
      arg: HTTP::FormData::File.new(@filepath)
    }
  }
end