class Ipfs::Client

Constants

API_VERSION
DEFAULT_ENDPOINT

Attributes

endpoint[R]

Public Class Methods

default() click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 12
def self.default
  new(DEFAULT_ENDPOINT)
end
new(endpoint) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 16
def initialize(endpoint)
  @endpoint = endpoint
end

Public Instance Methods

add(file) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 36
def add(file)
  Commands::Add.call self, file
end
add_dir(dir) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 40
def add_dir(dir)
  Commands::AddDir.call self, dir
end
base_url() click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 20
def base_url
  "#{endpoint}/api/#{API_VERSION}"
end
cat(node) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 28
def cat(node)
  Commands::Cat.call self, node
end
cat_to_file(node, path) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 32
def cat_to_file(node, path)
  Commands::CatToFile.call self, node, path
end
ls(node) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 24
def ls(node)
  Commands::Ls.call self, node
end
pin_add(node, recursive: true) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 48
def pin_add(node, recursive: true)
  Commands::PinAdd.call self, node, recursive: recursive
end
pin_rm(node, recursive: true) click to toggle source
# File lib/ipfs-http-client-rb/client.rb, line 44
def pin_rm(node, recursive: true)
  Commands::PinRm.call self, node, recursive: recursive
end