Class: Ipfs::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ipfs-api.rb

Instance Method Summary collapse

Constructor Details

#initialize(server = {}) ⇒ Client

Returns a new instance of Client.



10
11
12
# File 'lib/ipfs-api.rb', line 10

def initialize(server = {})
  @request = Request.new server
end

Instance Method Details

#cat(multi_hash) ⇒ Object



22
23
24
# File 'lib/ipfs-api.rb', line 22

def cat(multi_hash)
  execute Command::Cat, Multihash.new(multi_hash)
end

#idObject



14
15
16
# File 'lib/ipfs-api.rb', line 14

def id
  execute Command::Id
end

#ls(multi_hash) ⇒ Object



26
27
28
# File 'lib/ipfs-api.rb', line 26

def ls(multi_hash)
  execute Command::Ls, Multihash.new(multi_hash)
end

#versionObject



18
19
20
# File 'lib/ipfs-api.rb', line 18

def version
  execute Command::Version
end