Class: Ipfs::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/client.rb,
lib/ipfs_api.rb

Constant Summary collapse

VERSION =
'0.5.0'

Instance Method Summary collapse

Constructor Details

#initialize(server = {}) ⇒ Client

Returns a new instance of Client.


7
8
9
# File 'lib/client.rb', line 7

def initialize(server = {})
  @http_api = HttpApi.new server
end

Instance Method Details

#add(filepath) ⇒ Object


27
28
29
# File 'lib/client.rb', line 27

def add(filepath)
  execute Command::Add, filepath
end

#cat(multihash) ⇒ Object


19
20
21
# File 'lib/client.rb', line 19

def cat(multihash)
  execute Command::Cat, multihash
end

#idObject


11
12
13
# File 'lib/client.rb', line 11

def id
  execute Command::Id
end

#ls(multihash) ⇒ Object


23
24
25
# File 'lib/client.rb', line 23

def ls(multihash)
  execute Command::Ls, multihash
end

#versionObject


15
16
17
# File 'lib/client.rb', line 15

def version
  execute Command::Version
end