Class: RemoteDroid::Client
- Inherits:
-
Object
- Object
- RemoteDroid::Client
- Defined in:
- lib/remotedroid.rb
Instance Method Summary collapse
- #export(s) ⇒ Object
-
#initialize(host = '127.0.0.1') ⇒ Client
constructor
A new instance of Client.
- #invoke(s, *args) ⇒ Object
- #query(id) ⇒ Object
- #store ⇒ Object
- #update(key, val) ⇒ Object
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 |
#store ⇒ Object
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 |