class IPFS::Client
Constants
- API_VERSION
- DEFAULT_HOST
- DEFAULT_PORT
Attributes
host[R]
port[R]
Public Class Methods
default()
click to toggle source
# File lib/ipfs/client.rb, line 14 def self.default new(host: DEFAULT_HOST, port: DEFAULT_PORT) end
new(host:, port:)
click to toggle source
# File lib/ipfs/client.rb, line 18 def initialize(host:, port:) @host = host @port = port end
Public Instance Methods
add(file)
click to toggle source
# File lib/ipfs/client.rb, line 35 def add(file) Commands::Add.call self, file end
api_url()
click to toggle source
# File lib/ipfs/client.rb, line 23 def api_url "#{host}:#{port}/api/#{API_VERSION}" end
cat(node)
click to toggle source
# File lib/ipfs/client.rb, line 31 def cat(node) Commands::Cat.call self, node end
ls(node)
click to toggle source
# File lib/ipfs/client.rb, line 27 def ls(node) Commands::LS.call self, node end
pin_rm(node, recursive: true)
click to toggle source
# File lib/ipfs/client.rb, line 39 def pin_rm(node, recursive: true) Commands::PinRm.call self, node, recursive: recursive end