Class: IPFS::Connection::NameCommand
- Inherits:
-
Object
- Object
- IPFS::Connection::NameCommand
- Defined in:
- lib/ipfs-api/connection.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(connection) ⇒ NameCommand
constructor
A new instance of NameCommand.
- #resolve(id = nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ NameCommand
Returns a new instance of NameCommand.
145 146 147 |
# File 'lib/ipfs-api/connection.rb', line 145 def initialize connection @connection = connection end |
Instance Method Details
#resolve(id = nil) ⇒ Object
149 150 151 152 153 154 155 156 157 |
# File 'lib/ipfs-api/connection.rb', line 149 def resolve id = nil @connection.instance_exec(self) do if id JSON.parse(post("name/resolve?arg=#{CGI.escape(id)}").body)['Path'] else JSON.parse(post('name/resolve').body)['Path'] end end end |