Class: Device::System
- Inherits:
-
Object
- Object
- Device::System
- Defined in:
- lib/device/system.rb
Class Attribute Summary collapse
-
.backlight ⇒ Object
Returns the value of attribute backlight.
-
.klass ⇒ Object
Returns the value of attribute klass.
-
.serial ⇒ Object
readonly
Returns the value of attribute serial.
Class Method Summary collapse
- .adapter ⇒ Object
- .app ⇒ Object
-
.battery ⇒ Object
Read the battery level, return the value in percentage.
- .beep ⇒ Object
- .brand ⇒ Object
- .model ⇒ Object
-
.power_supply ⇒ Object
Check if device is connected to any power supply true Connected false Not Connected.
- .reboot ⇒ Object
- .restart ⇒ Object
- .update(path) ⇒ Object
- .versions ⇒ Object
Class Attribute Details
.backlight ⇒ Object
Returns the value of attribute backlight.
5 6 7 |
# File 'lib/device/system.rb', line 5 def backlight @backlight end |
.klass ⇒ Object
Returns the value of attribute klass.
6 7 8 |
# File 'lib/device/system.rb', line 6 def klass @klass end |
.serial ⇒ Object (readonly)
Returns the value of attribute serial.
5 6 7 |
# File 'lib/device/system.rb', line 5 def serial @serial end |
Class Method Details
.adapter ⇒ Object
9 10 11 |
# File 'lib/device/system.rb', line 9 def self.adapter Device.adapter::System end |
.app ⇒ Object
56 57 58 |
# File 'lib/device/system.rb', line 56 def self.app self.klass.to_s.downcase end |
.battery ⇒ Object
Read the battery level, return the value in percentage.
40 41 42 |
# File 'lib/device/system.rb', line 40 def self.battery adapter.battery end |
.beep ⇒ Object
44 45 46 |
# File 'lib/device/system.rb', line 44 def self.beep adapter.beep end |
.brand ⇒ Object
64 65 66 |
# File 'lib/device/system.rb', line 64 def self.brand adapter.brand end |
.model ⇒ Object
60 61 62 |
# File 'lib/device/system.rb', line 60 def self.model adapter.model end |
.power_supply ⇒ Object
Check if device is connected to any power supply
true Connected
false Not Connected
35 36 37 |
# File 'lib/device/system.rb', line 35 def self.power_supply adapter.power_supply end |
.reboot ⇒ Object
52 53 54 |
# File 'lib/device/system.rb', line 52 def self.reboot adapter.reboot end |
.restart ⇒ Object
48 49 50 |
# File 'lib/device/system.rb', line 48 def self.restart adapter.reboot end |
.update(path) ⇒ Object
72 73 74 75 76 |
# File 'lib/device/system.rb', line 72 def self.update(path) if File.exists? path adapter.update(path) end end |
.versions ⇒ Object
68 69 70 |
# File 'lib/device/system.rb', line 68 def self.versions adapter.versions end |