Class: RemoteDroid::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(host = '127.0.0.1') ⇒ Client

Returns a new instance of Client.



539
540
541
# File 'lib/remotedroid.rb', line 539

def initialize(host='127.0.0.1')
  @drb = OneDrb::Client.new host: host, port: '5777'    
end

Instance Method Details

#export(s) ⇒ Object



543
544
545
# File 'lib/remotedroid.rb', line 543

def export(s)
  @drb.export(s)
end

#invoke(s, *args) ⇒ Object



547
548
549
# File 'lib/remotedroid.rb', line 547

def invoke(s, *args)
  @drb.invoke(s, *args)
end

#query(id) ⇒ Object



551
552
553
554
555
556
557
# File 'lib/remotedroid.rb', line 551

def query(id)
  
  t = Time.now
  h = @drb.query(id)
  h.merge({latency: (Time.now - t).round(3)})
  
end

#storeObject



563
564
565
# File 'lib/remotedroid.rb', line 563

def store()
  @drb.store
end

#update(key, val) ⇒ Object



559
560
561
# File 'lib/remotedroid.rb', line 559

def update(key, val)
  @drb.update key.to_sym, val
end