Class: MindMeld::Hive
Instance Method Summary collapse
- #connect(device_id) ⇒ Object
- #device_details(options = { refresh: false }) ⇒ Object
- #disconnect(device_id) ⇒ Object
-
#initialize(options) ⇒ Hive
constructor
A new instance of Hive.
Methods inherited from Device
#add_statistics, #clear_state, #create_action, #hive_queues, #id, #name, #poll, #register, #send_screenshot, #set_state
Methods inherited from MindMeld
#add_statistics, #devices, #flush_statistics
Constructor Details
#initialize(options) ⇒ Hive
Returns a new instance of Hive.
4 5 6 7 |
# File 'lib/mind_meld/hive.rb', line 4 def initialize [:device][:device_type] = 'Hive' super end |
Instance Method Details
#connect(device_id) ⇒ Object
9 10 11 |
# File 'lib/mind_meld/hive.rb', line 9 def connect device_id request :put, 'plugin/hive/connect', { connection: { hive_id: self.id, device_id: device_id } } end |
#device_details(options = { refresh: false }) ⇒ Object
17 18 19 20 21 |
# File 'lib/mind_meld/hive.rb', line 17 def device_details( = { refresh: false }) super @device_details['connected_devices'] = [] if not (@device_details.has_key? 'connected_devices' or @device_details.has_key? 'error') @device_details end |
#disconnect(device_id) ⇒ Object
13 14 15 |
# File 'lib/mind_meld/hive.rb', line 13 def disconnect device_id request :put, 'plugin/hive/disconnect', { connection: { hive_id: self.id, device_id: device_id } } end |