Class: MVM::Bridge
- Inherits:
-
Object
- Object
- MVM::Bridge
- Defined in:
- lib/mvm/bridge.rb
Overview
Instance Attribute Summary collapse
-
#client ⇒ MVM::Client
readonly
The HTTP client for bridge operations.
Instance Method Summary collapse
-
#info ⇒ Hash
Retrieves bridge service information.
-
#initialize ⇒ Bridge
constructor
Initializes a new Bridge instance.
-
#user(public_key) ⇒ Hash
Retrieves or creates user information on the bridge.
Constructor Details
Instance Attribute Details
#client ⇒ MVM::Client (readonly)
Returns the HTTP client for bridge operations.
19 20 21 |
# File 'lib/mvm/bridge.rb', line 19 def client @client end |
Instance Method Details
#info ⇒ Hash
Retrieves bridge service information.
Returns general information about the bridge service including supported features, version, and status.
43 44 45 |
# File 'lib/mvm/bridge.rb', line 43 def info client.get '/' end |
#user(public_key) ⇒ Hash
Retrieves or creates user information on the bridge.
Registers a user’s public key with the bridge service, enabling them to perform cross-chain operations.
61 62 63 64 65 66 67 68 69 |
# File 'lib/mvm/bridge.rb', line 61 def user(public_key) path = '/users' payload = { public_key: } client.post path, **payload end |