Class: Ipfs::Commands::Add

Inherits:
Base
  • Object
show all
Defined in:
lib/ipfs-http-client-rb/commands/add.rb

Class Method Summary collapse

Methods inherited from Base

parse, request

Class Method Details

.call(client, file) ⇒ Object



6
7
8
9
# File 'lib/ipfs-http-client-rb/commands/add.rb', line 6

def self.call(client, file)
  response = request(client, "/add", {form: {file: HTTP::FormData::File.new(file)}})
  parse(response.body)
end