Class: Device::System

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.backlightObject

Returns the value of attribute backlight.



5
6
7
# File 'lib/device/system.rb', line 5

def backlight
  @backlight
end

.klassObject

Returns the value of attribute klass.



6
7
8
# File 'lib/device/system.rb', line 6

def klass
  @klass
end

.serialObject (readonly)

Returns the value of attribute serial.



5
6
7
# File 'lib/device/system.rb', line 5

def serial
  @serial
end

Class Method Details

.adapterObject



9
10
11
# File 'lib/device/system.rb', line 9

def self.adapter
  Device.adapter::System
end

.appObject



77
78
79
# File 'lib/device/system.rb', line 77

def self.app
  self.klass.to_s.downcase
end

.batteryObject

Read the battery level, return the value in percentage.



44
45
46
# File 'lib/device/system.rb', line 44

def self.battery
  adapter.battery
end

.battery_capacity_typeObject

Checks the type of the battery capacity return (percentage or scale).



49
50
51
52
53
54
55
# File 'lib/device/system.rb', line 49

def self.battery_capacity_type
  begin
    adapter.battery_capacity_type
  rescue StandardError => exception
    'scale'
  end
end

.beepObject



57
58
59
# File 'lib/device/system.rb', line 57

def self.beep
  adapter.beep
end

.brandObject



85
86
87
# File 'lib/device/system.rb', line 85

def self.brand
  adapter.brand
end

.modelObject



81
82
83
# File 'lib/device/system.rb', line 81

def self.model
  adapter.model
end

.power_supplyObject

Check if device is connected to any power supply

true Connected
false Not Connected


39
40
41
# File 'lib/device/system.rb', line 39

def self.power_supply
  adapter.power_supply
end

.rebootObject



65
66
67
# File 'lib/device/system.rb', line 65

def self.reboot
  adapter.reboot
end

.restartObject



61
62
63
# File 'lib/device/system.rb', line 61

def self.restart
  adapter.reboot
end

.teardownObject



13
14
15
# File 'lib/device/system.rb', line 13

def self.teardown
  adapter.teardown if adapter.respond_to?(:teardown)
end

.update(path) ⇒ Object



93
94
95
# File 'lib/device/system.rb', line 93

def self.update(path)
  adapter.update(path)
end

.versionsObject



89
90
91
# File 'lib/device/system.rb', line 89

def self.versions
  adapter.versions
end