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.



716
717
718
# File 'lib/remotedroid.rb', line 716

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

Instance Method Details

#controlObject



720
721
722
# File 'lib/remotedroid.rb', line 720

def control
  @drb.control
end

#export(s) ⇒ Object



724
725
726
# File 'lib/remotedroid.rb', line 724

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

#invoke(s, *args) ⇒ Object



728
729
730
# File 'lib/remotedroid.rb', line 728

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

#query(id = nil) ⇒ Object



732
733
734
735
736
737
738
739
# File 'lib/remotedroid.rb', line 732

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

#storeObject



745
746
747
# File 'lib/remotedroid.rb', line 745

def store()
  @drb.store
end

#update(key, val) ⇒ Object



741
742
743
# File 'lib/remotedroid.rb', line 741

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