Class: RemoteDroid::Clients

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostx = '127.0.0.1', host: hostx, port: '5777', sps_host: 'sps.home', sps_port: '59000') ⇒ Clients

Returns a new instance of Clients.



693
694
695
696
697
698
699
700
701
702
703
704
# File 'lib/remotedroid.rb', line 693

def initialize(hostx='127.0.0.1', host: hostx, port: '5777', 
               sps_host: 'sps.home', sps_port: '59000')  

  @drb = OneDrb::Client.new host: host, port: port        
  #sleep 3
  @devices = @drb.devices.keys.inject({}) do |r, name|
    obj = RemoteDroid::Client.new(host: host, port: port, 
                      sps_host: sps_host, sps_port: sps_port, device: name)
    r.merge!(name => obj)
  end
  
end

Instance Attribute Details

#devicesObject (readonly)

Returns the value of attribute devices.



691
692
693
# File 'lib/remotedroid.rb', line 691

def devices
  @devices
end

Instance Method Details

#device(name) ⇒ Object



706
707
708
709
# File 'lib/remotedroid.rb', line 706

def device(name)
  idx = @devices.index name.to_sym
  @devices[idx] if idx
end