Class: MVM::Bridge

Inherits:
Object
  • Object
show all
Defined in:
lib/mvm/bridge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBridge

Returns a new instance of Bridge.



7
8
9
# File 'lib/mvm/bridge.rb', line 7

def initialize
  @client = MVM::Client.new 'bridge.mvm.dev'
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/mvm/bridge.rb', line 5

def client
  @client
end

Instance Method Details

#infoObject



11
12
13
# File 'lib/mvm/bridge.rb', line 11

def info
  client.get '/'
end

#user(public_key) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/mvm/bridge.rb', line 15

def user(public_key)
  path = '/users'

  payload = {
    public_key:
  }

  client.post path, **payload
end