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.
-
.battery_capacity_type ⇒ Object
Checks the type of the battery capacity return (percentage or scale).
- .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
- .teardown ⇒ 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
77 78 79 |
# File 'lib/device/system.rb', line 77 def self.app self.klass.to_s.downcase end |
.battery ⇒ Object
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_type ⇒ Object
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 |
.beep ⇒ Object
57 58 59 |
# File 'lib/device/system.rb', line 57 def self.beep adapter.beep end |
.brand ⇒ Object
85 86 87 |
# File 'lib/device/system.rb', line 85 def self.brand adapter.brand end |
.model ⇒ Object
81 82 83 |
# File 'lib/device/system.rb', line 81 def self.model adapter.model end |
.power_supply ⇒ Object
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 |
.reboot ⇒ Object
65 66 67 |
# File 'lib/device/system.rb', line 65 def self.reboot adapter.reboot end |
.restart ⇒ Object
61 62 63 |
# File 'lib/device/system.rb', line 61 def self.restart adapter.reboot end |
.teardown ⇒ Object
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 |
.versions ⇒ Object
89 90 91 |
# File 'lib/device/system.rb', line 89 def self.versions adapter.versions end |