Class: Ipfs::Client
- Inherits:
-
Object
- Object
- Ipfs::Client
- Defined in:
- lib/ruby-ipfs-http-client/client.rb
Overview
The client is not intended to be manipulated. It is a singleton class used to route commands and their corresponding requests.
However, it contains certain, read-only, information that can be useful for debugging purposes.
Constant Summary collapse
- DEFAULT_BASE_PATH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'/api/v0'
- CONNECTION_METHODS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[ Connection::Default, Connection::IpfsConfig, Connection::Unreachable ]
Class Method Summary collapse
-
.daemon ⇒ Hash{Symbol => String}
Various debugging information concerning the running Ipfs daemon and this library.
- .execute(command, *args) ⇒ Object private
-
.id ⇒ Hash{Symbol => String, Array<String>}
Various debugging information concerning the Ipfs node itself.
- .initialize ⇒ Object
Class Method Details
.daemon ⇒ Hash{Symbol => String}
Various debugging information concerning the running Ipfs daemon and this library
82 83 84 |
# File 'lib/ruby-ipfs-http-client/client.rb', line 82 def daemon @@daemon end |
.execute(command, *args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/ruby-ipfs-http-client/client.rb', line 41 def execute(command, *args) command.parse_response call command.build_request *args end |
.id ⇒ Hash{Symbol => String, Array<String>}
Various debugging information concerning the Ipfs node itself
64 65 66 |
# File 'lib/ruby-ipfs-http-client/client.rb', line 64 def id @@id end |
.initialize ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/ruby-ipfs-http-client/client.rb', line 30 def initialize attempt_connection retrieve_ids retrieve_daemon_version ObjectSpace.define_finalizer(self, proc { @@connection.close }) end |